-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRoutes.cs
48 lines (44 loc) · 1.88 KB
/
Routes.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Web.Routing;
using Orchard.Mvc.Routes;
namespace JsonProjection
{
public class Routes : IRouteProvider
{
public string Area
{
get { return "JsonProjection"; }
}
public Routes()
{
}
public void GetRoutes(ICollection<RouteDescriptor> routes)
{
foreach (var routeDescriptor in GetRoutes())
routes.Add(routeDescriptor);
}
public IEnumerable<RouteDescriptor> GetRoutes()
{
return new[] {
new RouteDescriptor {
Route = new Route(
"Admin/JsonProjection/Preview/{id}",
new RouteValueDictionary {
{"area", this.Area},
{"controller", "Service"},
{"action", "Preview"}
},
new RouteValueDictionary(),
new RouteValueDictionary {
{"area", this.Area }
},
new MvcRouteHandler())
}
};
}
}
}