10
|
1 using System;
|
|
2 using System.Collections.Generic;
|
|
3 using System.Linq;
|
|
4 using System.Web.Mvc;
|
|
5 using System.Web.Routing;
|
19
|
6 using Agendas.Factories;
|
10
|
7
|
|
8 namespace Agendas.Web
|
|
9 {
|
|
10 // Note: For instructions on enabling IIS6 or IIS7 classic mode,
|
|
11 // visit http://go.microsoft.com/?LinkId=9394801
|
|
12
|
|
13 public class MvcApplication : System.Web.HttpApplication
|
|
14 {
|
|
15 public static void RegisterGlobalFilters(GlobalFilterCollection filters)
|
|
16 {
|
|
17 filters.Add(new HandleErrorAttribute());
|
|
18 }
|
|
19
|
|
20 public static void RegisterRoutes(RouteCollection routes)
|
|
21 {
|
|
22 routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
|
|
23
|
|
24 routes.MapRoute(
|
|
25 "Default", // Route name
|
|
26 "{controller}/{action}/{id}", // URL with parameters
|
|
27 new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
|
|
28 );
|
|
29
|
|
30 }
|
|
31
|
|
32 protected void Application_Start()
|
|
33 {
|
|
34 AreaRegistration.RegisterAllAreas();
|
|
35
|
|
36 RegisterGlobalFilters(GlobalFilters.Filters);
|
|
37 RegisterRoutes(RouteTable.Routes);
|
19
|
38
|
|
39 AgendaFactory.SetIdentityProvider(new HttpContextIdentityProvider());
|
10
|
40 }
|
|
41 }
|
|
42 } |