-
Notifications
You must be signed in to change notification settings - Fork 100
/
Copy pathLinkTemplates.cs
72 lines (62 loc) · 2.34 KB
/
LinkTemplates.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
namespace WebApi.Hal.Web
{
public static class LinkTemplates
{
public static class Breweries
{
/// <summary>
/// /breweries
/// </summary>
public static Link GetBreweries { get { return new Link("breweries", "~/breweries"); } }
/// <summary>
/// /breweries/{id}
/// </summary>
public static Link Brewery { get { return new Link("brewery", "~/breweries/{id}"); } }
/// <summary>
/// /breweries/{id}/beers
/// </summary>
public static Link AssociatedBeers { get { return new Link("beers", "~/breweries/{id}/beers{?page}"); } }
}
public static class BeerStyles
{
/// <summary>
/// /styles
/// </summary>
public static Link GetStyles { get { return new Link("styles", "~/styles"); } }
/// <summary>
/// /styles/{id}/beers
/// </summary>
public static Link AssociatedBeers { get { return new Link("beers", "~/styles/{id}/beers{?page}"); } }
/// <summary>
/// /styles/{id}
/// </summary>
public static Link Style { get { return new Link("style", "~/styles/{id}"); } }
}
public static class Beers
{
/// <summary>
/// /beers?page={page}
/// </summary>
public static Link GetBeers { get { return new Link("beers", "~/beers{?page}"); } }
/// <summary>
/// /beers?searchTerm={searchTerm}&page={page}
/// </summary>
public static Link SearchBeers { get { return new Link("page", "~/beers{?searchTerm,page}"); } }
/// <summary>
/// /beers/{id}
/// </summary>
public static Link Beer { get { return new Link("beer", "~/beer/{id}"); } }
}
public static class BeerDetails
{
public static Link GetBeerDetail { get { return new Link("beerdetail", "~/beerdetail/{id}"); } }
}
public static class Reviews
{
/// <summary>
/// /beers/{id}/reviews/{rid}
/// </summary>
public static Link GetBeerReview { get { return new Link("review", "~/beers/{id}/reviews/{rid}"); } }
}
}
}