/// <summary>Integrates Unity when the application starts.</summary> public static void Start() { // Use UnityHierarchicalDependencyResolver if you want to use a new child container for each IHttpController resolution. // var resolver = new UnityHierarchicalDependencyResolver(UnityConfig.GetConfiguredContainer()); var resolver = new UnityDependencyResolver(ContainerBootstrapper.GetConfiguredContainer()); GlobalConfiguration.Configuration.DependencyResolver = resolver; }
/// <summary>Disposes the Unity container when the application is shut down.</summary> public static void Shutdown() { var container = ContainerBootstrapper.GetConfiguredContainer(); container.Dispose(); }