/// <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(UnityConfig.GetConfiguredContainer());
     GlobalConfiguration.Configuration.DependencyResolver = resolver;
     UnityConfig.GetConfiguredContainer().Resolve<IReflector>().Reflect();
 }
Exemplo n.º 2
0
 /// <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(UnityConfig.GetConfiguredContainer());
     // Microsoft.Web.Infrastructure.DynamicModuleHelper.DynamicModuleUtility.RegisterModule(typeof(UnityPerRequestHttpModule));
     GlobalConfiguration.Configuration.DependencyResolver = resolver;
 }