Top "Inversion-of-control" questions

Inversion of control (IoC) is an abstract principle describing an aspect of some software architecture designs in which the flow of control of a system is inverted in comparison to procedural programming.

Autofac with multiple implementations of the same interface

I'm using Autofac and would like to have multiple implementations of an interface. How can I configure Autofac so to …

c# dependency-injection inversion-of-control autofac
How to use Property Injection with AutoFac?

In a Console application, I'm using Log4Net and in the Main method I'm getting the logger object. Now, I'd …

c# asp.net inversion-of-control log4net autofac
Base controller constructor injection in ASP.NET MVC with Unity

I have a base controller in my MVC 5 project which implements some shared functionality. This functionality requires some dependencies. I …

c# asp.net-mvc dependency-injection inversion-of-control unity-container
Resolve IContainer

What is the suggested method of getting the Autofac container from inside a class in the application? Does Autofac provide …

c# dependency-injection inversion-of-control autofac
Where exactly is the difference between IoC and DI

Possible Duplicate: Inversion of Control < Dependency Injection I always read IoC(Inversion of Control) and DI(Dependency Injection) in …

dependency-injection inversion-of-control
Dependency injection through constructors or property setters?

I'm refactoring a class and adding a new dependency to it. The class is currently taking its existing dependencies in …

dependency-injection inversion-of-control
UnityContainer.Resolve or ServiceLocator.GetInstance?

It could seem a stupid question because in my code everything is working, but I've registered a singleton this way …

c# dependency-injection inversion-of-control unity-container
2 beans with same name but in different packages; how to autowire them?

I have an application that has 2 beans with the same name, but which are in different packages. My Spring application …

spring inversion-of-control autowired
How to inject dependency property using Ioc Unity

I have the following classes: public interface IServiceA { string MethodA1(); } public interface IServiceB { string MethodB1(); } public class ServiceA : IServiceA { public …

c# inversion-of-control unity-container ioc-container property-injection
How do I correctly use Unity to pass a ConnectionString to my repository classes?

I've literally just started using the Unity Application Blocks Dependency Injection library from Microsoft, and I've come unstuck. This is …

c# dependency-injection inversion-of-control unity-container repository-pattern