public void Initialize(IDIContext context) { context.s().Rebind <ILog>(null, BindingName.For(LogType.Decorated)); context.m().Bind <ILogOwner>(() => new MyLogOwner()); context.s().Bind <IWorld>(() => new Earth()); context.s().Bind <ISky>(() => new Sky()); context.m().Bind <IHumanFactory>(() => new HumanFactory()); context.m().Bind <IHuman>(() => new Human()); }
public void Initialize(IDIContext context) { context.m().Bind <ILog>(() => new SimpleLog(), BindingName.For(LogType.Simple)); context.m().Bind <ILog>(() => new DecoratedLog(context.Resolve <ILog>(BindingName.For(LogType.Simple))), BindingName.For(LogType.Decorated)); context.m().Bind <ILogOwner>(() => new CoreLogOwner()); }