Property Injection

Jun 29, 2010 at 9:08 AM


Does Funq support Property Injection?

Jun 29, 2010 at 9:20 PM
Sure thing! Because you're registering the object construction yourself, you can use object initializer syntax to initialize property dependencies too. There's no magic auto-wiring or any reflection going on. Just plain "old" lambda "magic".
Jun 29, 2010 at 10:02 PM

Ok. So in a case when I want the container to resolve the property dependency, I would just write:

container.Register<IFoo>(c => new Foo(){Bar = c.Resolve<IBar>()});

Is that right?


Jun 29, 2010 at 10:04 PM
precisely :)