forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRouteMatchService.cs
More file actions
59 lines (49 loc) · 1.51 KB
/
Copy pathRouteMatchService.cs
File metadata and controls
59 lines (49 loc) · 1.51 KB
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
49
50
51
52
53
54
55
56
57
58
59
using ServiceStack;
namespace Check.ServiceInterface
{
[Route("/matchroute/html", Matches = "AcceptsHtml")]
public class MatchesHtml : IReturn<MatchesHtml>
{
public string Name { get; set; }
}
[Route("/matchroute/json", Matches = "AcceptsJson")]
public class MatchesJson : IReturn<MatchesJson>
{
public string Name { get; set; }
}
[Route("/matchroute/csv", Matches = "AcceptsCsv")]
public class MatchesCsv : IReturn<MatchesCsv>
{
public string Name { get; set; }
}
[Route("/matchlast/{Id}", Matches = @"**/{int}")]
public class MatchesLastInt
{
public int Id { get; set; }
}
[Route("/matchlast/{Slug}")]
public class MatchesNotLastInt
{
public string Slug { get; set; }
}
[Route("/matchregex/{Id}", Matches = @"PathInfo =~ \/[0-9]+$")]
public class MatchesId
{
public int Id { get; set; }
}
[Route("/matchregex/{Slug}")]
public class MatchesSlug
{
public string Slug { get; set; }
}
public class RouteMatchService : Service
{
public object Any(MatchesHtml request) => request;
public object Any(MatchesJson request) => request;
//public object Any(MatchesCsv request) => request;
public object Any(MatchesLastInt request) => request;
public object Any(MatchesNotLastInt request) => request;
public object Any(MatchesId request) => request;
public object Any(MatchesSlug request) => request;
}
}