Guest User

Untitled

a guest
Jun 24th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. public class StructureMapControllerFactory : DefaultControllerFactory
  2. {
  3. protected override IController GetControllerInstance(Type controllerType)
  4. {
  5. if (controllerType == null)
  6. throw new ArgumentNullException("controllerType");
  7.  
  8. return ObjectFactory.GetInstance(controllerType) as Controller;
  9. }
  10. }
  11.  
  12. protected void Application_Start()
  13. {
  14. RegisterRoutes(RouteTable.Routes);
  15.  
  16. Bootstrapper.ConfigureStructureMap();
  17.  
  18. ControllerBuilder.Current.SetControllerFactory(new StructureMapControllerFactory());
  19. }
  20.  
  21. if(controllerType == null)
  22. return base.GetControllerInstance(controllerType)
  23.  
  24. background: url(img/logo.gif);
  25.  
  26. routes.IgnoreRoute("{Content}/{*pathInfo}");
  27.  
  28. routes.IgnoreRoute("{*favicon}", new {favicon=@"(.*/)?favicon.ico(/.*)?"})
Add Comment
Please, Sign In to add comment