Skip to content

Instantly share code, notes, and snippets.

@blachniet
blachniet / ModifiedNinjectWebCommon.cs
Created April 9, 2012 16:32 — forked from haacked/ServiceResolverAdapter.cs
ServiceResolverAdapter: Allows you to use the ASP.NET MVC DependencyResolver for ASP.NET Web API
/// <summary>
/// Starts the application
/// </summary>
public static void Start()
{
DynamicModuleUtility.RegisterModule(typeof(OnePerRequestHttpModule));
DynamicModuleUtility.RegisterModule(typeof(NinjectHttpModule));
bootstrapper.Initialize(CreateKernel);
System.Web.Http.GlobalConfiguration.Configuration.ServiceResolver.SetResolver(System.Web.Mvc.DependencyResolver.Current.ToServiceResolver());