comparison Source/ServiceModel/LinqServiceClient.cs @ 0:f990fcb411a9

Копия текущей версии из github
author cin
date Thu, 27 Mar 2014 21:46:09 +0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f990fcb411a9
1 using System;
2 using System.ServiceModel;
3 using System.ServiceModel.Channels;
4
5 namespace BLToolkit.ServiceModel
6 {
7 class LinqServiceClient : ClientBase<ILinqService>, ILinqService, IDisposable
8 {
9 #region Init
10
11 //public LinqServiceClient() {}
12 public LinqServiceClient(string endpointConfigurationName) : base(endpointConfigurationName) { }
13 public LinqServiceClient(string endpointConfigurationName, string remoteAddress) : base(endpointConfigurationName, remoteAddress) { }
14 public LinqServiceClient(string endpointConfigurationName, EndpointAddress remoteAddress) : base(endpointConfigurationName, remoteAddress) { }
15 public LinqServiceClient(Binding binding, EndpointAddress remoteAddress) : base(binding, remoteAddress) { }
16 //public LinqServiceClient(InstanceContext callbackInstance) : base(callbackInstance) { }
17 //public LinqServiceClient(InstanceContext callbackInstance, string endpointConfigurationName) : base(callbackInstance, endpointConfigurationName) { }
18 //public LinqServiceClient(InstanceContext callbackInstance, string endpointConfigurationName, string remoteAddress) : base(callbackInstance, endpointConfigurationName, remoteAddress) { }
19 //public LinqServiceClient(InstanceContext callbackInstance, string endpointConfigurationName, EndpointAddress remoteAddress) : base(callbackInstance, endpointConfigurationName, remoteAddress) { }
20 //public LinqServiceClient(InstanceContext callbackInstance, Binding binding, EndpointAddress remoteAddress) : base(callbackInstance, binding, remoteAddress) { }
21
22 #endregion
23
24 #region ILinqService Members
25
26 public string GetSqlProviderType()
27 {
28 return Channel.GetSqlProviderType();
29 }
30
31 public int ExecuteNonQuery(string queryData)
32 {
33 return Channel.ExecuteNonQuery(queryData);
34 }
35
36 public object ExecuteScalar(string queryData)
37 {
38 return Channel.ExecuteScalar(queryData);
39 }
40
41 public string ExecuteReader(string queryData)
42 {
43 return Channel.ExecuteReader(queryData);
44 }
45
46 public int ExecuteBatch(string queryData)
47 {
48 return Channel.ExecuteBatch(queryData);
49 }
50
51 #endregion
52
53 #region IDisposable Members
54
55 void IDisposable.Dispose()
56 {
57 try
58 {
59 if (State != CommunicationState.Faulted)
60 ((ICommunicationObject)this).Close();
61 else
62 Abort();
63 }
64 catch (CommunicationException)
65 {
66 Abort();
67 }
68 catch (TimeoutException)
69 {
70 Abort();
71 }
72 catch (Exception)
73 {
74 Abort();
75 throw;
76 }
77 }
78
79 #endregion
80 }
81 }