You'd first have to configure your Unity DI container. The common practice is to create a bootstrapper, with a static method to handle the registrations, like:
public class ContainerBootstrapper {
public static void RegisterTypes(IUnityContainer container) {
container.RegisterType<ICustomer, CustomerImplementation>(/* configure your class implementation here */);
container.RegisterType<ISiteSettings, SettingsImplementation>(...);
container.RegisterType<ILogger, LoggerImplementation(...));
...
}
}
and call it from your global.asax
var container = new UnityContainer();
ContainerBootstrap.RegisterTypes(container);
To resolve controller in an ASP.NET MVC4 application, you need to replace the standard Controller factory implementation. For more information check out Unity documentation on MSDN.
There is a "Unity bootstrapper for ASP.NET MVC" nuget package available, which containers a standard UnityDependencyResolver
implementation, you just need to register it with:
DependencyResolver.SetResolver(new UnityDependencyResolver(container));