forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGenericProxy.cs
More file actions
48 lines (43 loc) · 1.13 KB
/
GenericProxy.cs
File metadata and controls
48 lines (43 loc) · 1.13 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
#if !SILVERLIGHT && !MONOTOUCH && !XBOX
using System.ServiceModel;
using System.ServiceModel.Description;
namespace ServiceStack.ServiceClient.Web
{
/// <summary>
/// Generic Proxy for service calls.
/// </summary>
/// <typeparam name="T">The service Contract</typeparam>
public class GenericProxy<T> : ClientBase<T> where T : class
{
public GenericProxy()
: base()
{
Initialize();
}
public GenericProxy(string endpoint)
: base(endpoint)
{
Initialize();
}
public GenericProxy(ServiceEndpoint endpoint)
: base(endpoint.Binding, endpoint.Address)
{
Initialize();
}
public void Initialize()
{
//this.Endpoint.Behaviors.Add(new ServiceEndpointBehaviour());
}
/// <summary>
/// Returns the transparent proxy for the service call
/// </summary>
public T Proxy
{
get
{
return base.Channel;
}
}
}
}
#endif