Пример #1
0
        /// <summary>调用</summary>
        public static async Task InvokeAsync <IWcfService>(this ClientBase <IWcfService> client, Func <IWcfService, Task> command)
            where IWcfService : class
        {
            var proxy = client.As <IWcfService>();

            client.InnerChannel.OperationTimeout = s_OperationTimeout;
            try
            {
                await command(proxy);

                client.Close();
            }
            catch
            {
                client.Abort();
                throw;
            }
        }