forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHelloService.cs
More file actions
65 lines (56 loc) · 1.25 KB
/
Copy pathHelloService.cs
File metadata and controls
65 lines (56 loc) · 1.25 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
60
61
62
63
64
65
using System.ComponentModel;
using System.Runtime.Serialization;
using ServiceStack.ServiceHost;
using ServiceStack.ServiceInterface;
namespace ServiceStack.WebHost.IntegrationTests.Services
{
[DataContract]
[Description("ServiceStack's Hello World web service.")]
[RestService("/hello")]
[RestService("/hello/{Name}")]
public class Hello
{
[DataMember]
public string Name { get; set; }
}
[DataContract]
public class HelloResponse
{
[DataMember]
public string Result { get; set; }
}
public class HelloService : IService<Hello>
{
public object Execute(Hello request)
{
return new HelloResponse { Result = "Hello, " + request.Name };
}
}
public class TestFilterAttribute : ResponseFilterAttribute
{
public override void Execute(IHttpRequest req, IHttpResponse res, object requestDto)
{
}
}
[RestService("/hello2")]
[RestService("/hello2/{Name}")]
public class Hello2
{
[DataMember]
public string Name { get; set; }
}
[DataContract]
public class Hello2Response
{
[DataMember]
public string Result { get; set; }
}
[TestFilter]
public class Hello2Service : IService<Hello2>
{
public object Execute(Hello2 request)
{
return request.Name;
}
}
}