public static void Register(HttpConfiguration config) { var container = new UnityContainer(); container.RegisterType(new HierarchicalLifetimeManager()); config.DependencyResolver = new UnityResolver(container); // Other Web API configuration not shown. }