Update docs to reflect the change.

This commit is contained in:
james7132
2017-02-10 22:11:06 +00:00
parent f1df412341
commit bb95686078
2 changed files with 120 additions and 99 deletions

View File

@@ -6,6 +6,7 @@ public class ModuleA : ModuleBase
{
private readonly DatabaseService _database;
// Dependencies can be injected via the constructor
public ModuleA(DatabaseService database)
{
_database = database;
@@ -20,12 +21,21 @@ public class ModuleA : ModuleBase
public class ModuleB
{
private CommandService _commands;
private NotificationService _notification;
// Public settable properties will be injected
public AnnounceService { get; set; }
// Public properties without setters will not
public CommandService Commands { get; }
// Public properties annotated with [DontInject] will not
[DontInject]
public NotificationService { get; set; }
public ModuleB(CommandService commands, IDependencyMap map)
{
_commands = commands;
Commands = commands;
_notification = map.Get<NotificationService>();
}
}
}