-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathRoutes.cs
31 lines (26 loc) · 901 Bytes
/
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
using System.Collections.Generic;
using System.Web;
using Orchard.Mvc.Routes;
using System.Linq;
using Orchard.WebApi.Routes;
using System.Web.Http;
namespace Morphous.AsyncShapes {
public class MorphousApiHttpRouteProvider : IHttpRouteProvider {
public MorphousApiHttpRouteProvider() {
}
public IEnumerable<RouteDescriptor> GetRoutes() {
return new[] {
new HttpRouteDescriptor {
Name = "MorphousApiItem",
Priority = 100,
RouteTemplate = "api/Contents/Item/{id}",
Defaults = new { area = "Morphous.Api", controller = "Item" }
}
};
}
public void GetRoutes(ICollection<RouteDescriptor> routes) {
foreach (var routeDescriptor in GetRoutes())
routes.Add(routeDescriptor);
}
}
}