Does Funq IoC Container support property injection?
-
01-10-2019 - |
Question
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?
Solution
Well wouldn't that generally go something like this?
myContainer.Register<IUserRepository>(() =>
{
var myRepository = new SomeUserRepository();
myRepository.SomeProperty = someValue;
return myRepository;
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow