示例#1
0
        public static T CallAccessService <T>(Func <IAccessService, T> call)
        {
            AccessServiceClient client = ClientFactory.CreateClient <AccessServiceClient, IAccessService>();

            try {
                return(call(client));
            }
            finally {
                try {
                    client.Close();
                }
                catch (Exception) {
                    client.Abort();
                }
            }
        }
示例#2
0
        public static void CallAccessService(Action <IAccessService> call)
        {
            AccessServiceClient client = ClientFactory.CreateClient <AccessServiceClient, IAccessService>();

            try {
                call(client);
            }
            finally {
                try {
                    client.Close();
                }
                catch (Exception) {
                    client.Abort();
                }
            }
        }