Top "Unity-container" questions

The Unity Application Block (i.e. Unity) is a lightweight, extensible dependency injection container for .NET with support for interception.

How to inject dependencies into the global.asax.cs

How do I inject dependencies into the global.asax.cs, i.e. the MvcApplication class? Having previously used the Service …

asp.net-mvc-3 dependency-injection unity-container
Unity - Inject different classes for the same interface

I have one interface: IFoo Two classes implementing that interface: FooOne and FooTwo And two classes ClassOne and ClassTwo receiving …

c# inversion-of-control unity-container
Why does Unity use a Service Locator?

I have seen this line of code in several tutorials for using Unity in asp.net mvc3. I was under …

asp.net-mvc-3 unity-container service-locator
How to use Repository Interface that uses Generics with Dependency Injection?

I am attempting to use the following Generic Repository Interface for DI and constructor injection: public interface IRepository<TEntity&…

c# dependency-injection unity-container ioc-container
MEF vs. any IoC

Looking at Microsoft's Managed Extensibility Framework (MEF) and various IoC containers (such as Unity), I am failing to see when …

inversion-of-control unity-container mef
Prism, connecting Views and ViewModels with Unity, trying to understand it

Creating the View and View Model Using Unity Using Unity as your dependency injection container is similar to using MEF, …

c# wpf mvvm prism unity-container
Should I use OwinContext's Environment to hold application specific data per request

I need a way to store a logging object per request. With HttpContext I would add this to the items …

c# asp.net unity-container owin owin-middleware
Unity: Replace registered type with another type at runtime

We have a scenario where the user can choose between different hardware at runtime. In the background we have several …

dependency-injection unity-container
asp.net identity 2.0 unity not resolving default user store

i get the following exception when trying to configure Unity using Unity.Mvc5 with an MVC 5 application using Identity 2.0 and …

asp.net-mvc dependency-injection unity-container asp.net-identity asp.net-identity-2
Use Unity to intercept all calls to IMyInterface.SomeMethod

I am trying to learn Unity Interceptors and I am having a hard go of it. Say I have an …

c# .net unity-container unity-interception