问题
I'm looking for an IoC container to use in my Compact Framework application. Trying out Funq I noticed that I can't find a way to do Property Injection with it.
I've looked through the discussion on the project's site and the unit tests for it, but I can't find any example of Property Injection.
Does Funq support Property Injection?
回答1:
Well wouldn't that generally go something like this?
myContainer.Register<IUserRepository>(() =>
{
var myRepository = new SomeUserRepository();
myRepository.SomeProperty = someValue;
return myRepository;
});
来源:https://stackoverflow.com/questions/3139209/does-funq-ioc-container-support-property-injection