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?
The IoC container that is also known as a DI Container is a framework for implementing automatic dependency injection very effectively. It manages the complete object creation and its lifetime, as well as it also injects the dependencies into the classes.
Inversion of Control(IoC) is also known as Dependency injection (DI). The Spring container uses Dependency Injection (DI) to manage the components that build up an application and these objects are called Spring Beans. Spring implements DI by either an XML configuration file or annotations.
There are three types of dependency injection — constructor injection, method injection, and property injection.
Dependency Injection is the method of providing the dependencies and Inversion of Control is the end result of Dependency Injection. IoC is a design principle where the control flow of the program is inverted. Dependency Injection is one of the subtypes of the IOC principle.
Well wouldn't that generally go something like this?
myContainer.Register<IUserRepository>(() =>
{
var myRepository = new SomeUserRepository();
myRepository.SomeProperty = someValue;
return myRepository;
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With