Skip to content

Instantly share code, notes, and snippets.

@kstenson
Created February 17, 2014 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kstenson/9059761 to your computer and use it in GitHub Desktop.
Save kstenson/9059761 to your computer and use it in GitHub Desktop.
public class MvcApplication : NinjectHttpApplication
{
protected void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new
{
controller = "Home",
action = "Index",
id = ""
} // Parameter defaults
);
}
protected override void OnApplicationStarted()
{
RegisterAllControllersIn(Assembly.GetExecutingAssembly());
RegisterRoutes(RouteTable.Routes);
}
protected override IKernel CreateKernel()
{
var kernel = new StandardKernel();
kernel.Load(Assembly.GetExecutingAssembly());
return kernel;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment