|
1 | 1 | using System.Collections.Generic; |
2 | 2 | using ServiceStack.Northwind.ServiceModel.Types; |
| 3 | +using ServiceStack.ServiceHost; |
3 | 4 | using ServiceStack.ServiceInterface.ServiceModel; |
4 | 5 |
|
5 | | -public class Customers {} |
6 | | -public class CustomerResponse : IHasResponseStatus |
| 6 | +namespace ServiceStack.Northwind.ServiceModel.Operations |
7 | 7 | { |
8 | | - public CustomerResponse() |
| 8 | + [RestService("/orders")] |
| 9 | + [RestService("/orders/page/{Page}")] |
| 10 | + [RestService("/customers/{CustomerId}/orders")] |
| 11 | + public class Orders |
9 | 12 | { |
10 | | - this.ResponseStatus = new ResponseStatus(); |
| 13 | + public int? Page { get; set; } |
| 14 | + |
| 15 | + public string CustomerId { get; set; } |
11 | 16 | } |
12 | | - |
13 | | - public Customer Customer { get; set; } |
14 | | - |
15 | | - public ResponseStatus ResponseStatus { get; set; } |
16 | | -} |
17 | | -public class CustomersResponse : IHasResponseStatus |
18 | | -{ |
19 | | - public CustomersResponse() |
| 17 | + |
| 18 | + public class OrdersResponse : IHasResponseStatus |
20 | 19 | { |
21 | | - this.ResponseStatus = new ResponseStatus(); |
22 | | - this.Customers = new List<Customer>(); |
23 | | - } |
24 | | - |
25 | | - public List<Customer> Customers { get; set; } |
26 | | - |
27 | | - public ResponseStatus ResponseStatus { get; set; } |
28 | | -} |
29 | | -public class CustomerDetails |
30 | | -{ |
31 | | - |
32 | | - public string Id { get; set; } |
33 | | -} |
| 20 | + public OrdersResponse() |
| 21 | + { |
| 22 | + this.ResponseStatus = new ResponseStatus(); |
| 23 | + this.Results = new List<CustomerOrder>(); |
| 24 | + } |
34 | 25 |
|
| 26 | + public List<CustomerOrder> Results { get; set; } |
35 | 27 |
|
36 | | -public class CustomerDetailsResponse : IHasResponseStatus |
37 | | -{ |
38 | | - public CustomerDetailsResponse() |
39 | | - { |
40 | | - this.ResponseStatus = new ResponseStatus(); |
41 | | - this.CustomerOrders = new List<CustomerOrder>(); |
| 28 | + public ResponseStatus ResponseStatus { get; set; } |
42 | 29 | } |
43 | | - |
44 | | - public Customer Customer { get; set; } |
45 | | - |
46 | | - public List<CustomerOrder> CustomerOrders { get; set; } |
47 | | - |
48 | | - public ResponseStatus ResponseStatus { get; set; } |
49 | | -} |
50 | | -public class Orders |
51 | | -{ |
52 | | - |
53 | | - public int? Page { get; set; } |
54 | | - |
55 | | - public string CustomerId { get; set; } |
56 | | -} |
57 | | -public class OrdersResponse : IHasResponseStatus |
58 | | -{ |
59 | | - public OrdersResponse() |
60 | | - { |
61 | | - this.ResponseStatus = new ResponseStatus(); |
62 | | - this.Results = new List<CustomerOrder>(); |
63 | | - } |
64 | | - |
65 | | - public List<CustomerOrder> Results { get; set; } |
66 | | - |
67 | | - public ResponseStatus ResponseStatus { get; set; } |
68 | | -} |
69 | | - |
70 | 30 |
|
| 31 | +} |
0 commit comments