Click here to Skip to main content
15,897,371 members
Articles / Programming Languages / C#

Frictionless WCF service consumption in Silverlight - Part 3: Benefits of transparent asynchrony with respect to unit testing

Rate me:
Please Sign up or sign in to vote.
4.78/5 (5 votes)
26 May 2011MIT15 min read 25.2K   259   11  
Simplifying unit testing of View Models which use asynchronous WCF service calls.
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.1
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

// 
// This code was auto-generated by Microsoft.Silverlight.ServiceReference, version 4.0.50826.0
// 
namespace Sample.Silverlight.WCF.Tests.Clumsy.ServiceReference1 {
    
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ServiceModel.ServiceContractAttribute(ConfigurationName="ServiceReference1.ITaskService")]
    public interface ITaskService {
        
        [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/ITaskService/GetAll", ReplyAction="http://tempuri.org/ITaskService/GetAllResponse")]
        System.IAsyncResult BeginGetAll(System.AsyncCallback callback, object asyncState);
        
        System.Collections.ObjectModel.ObservableCollection<Sample.Silverlight.WCF.Web.Services.Task> EndGetAll(System.IAsyncResult result);
        
        [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/ITaskService/Create", ReplyAction="http://tempuri.org/ITaskService/CreateResponse")]
        System.IAsyncResult BeginCreate(string description, System.AsyncCallback callback, object asyncState);
        
        Sample.Silverlight.WCF.Web.Services.Task EndCreate(System.IAsyncResult result);
        
        [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/ITaskService/MarkComplete", ReplyAction="http://tempuri.org/ITaskService/MarkCompleteResponse")]
        System.IAsyncResult BeginMarkComplete(System.Guid id, System.AsyncCallback callback, object asyncState);
        
        Sample.Silverlight.WCF.Web.Services.Task EndMarkComplete(System.IAsyncResult result);
        
        [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/ITaskService/Delete", ReplyAction="http://tempuri.org/ITaskService/DeleteResponse")]
        System.IAsyncResult BeginDelete(System.Guid id, System.AsyncCallback callback, object asyncState);
        
        void EndDelete(System.IAsyncResult result);
    }
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public interface ITaskServiceChannel : Sample.Silverlight.WCF.Tests.Clumsy.ServiceReference1.ITaskService, System.ServiceModel.IClientChannel {
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public partial class GetAllCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        public GetAllCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        public System.Collections.ObjectModel.ObservableCollection<Sample.Silverlight.WCF.Web.Services.Task> Result {
            get {
                base.RaiseExceptionIfNecessary();
                return ((System.Collections.ObjectModel.ObservableCollection<Sample.Silverlight.WCF.Web.Services.Task>)(this.results[0]));
            }
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public partial class CreateCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        public CreateCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        public Sample.Silverlight.WCF.Web.Services.Task Result {
            get {
                base.RaiseExceptionIfNecessary();
                return ((Sample.Silverlight.WCF.Web.Services.Task)(this.results[0]));
            }
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public partial class MarkCompleteCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        public MarkCompleteCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        public Sample.Silverlight.WCF.Web.Services.Task Result {
            get {
                base.RaiseExceptionIfNecessary();
                return ((Sample.Silverlight.WCF.Web.Services.Task)(this.results[0]));
            }
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public partial class TaskServiceClient : System.ServiceModel.ClientBase<Sample.Silverlight.WCF.Tests.Clumsy.ServiceReference1.ITaskService>, Sample.Silverlight.WCF.Tests.Clumsy.ServiceReference1.ITaskService {
        
        private BeginOperationDelegate onBeginGetAllDelegate;
        
        private EndOperationDelegate onEndGetAllDelegate;
        
        private System.Threading.SendOrPostCallback onGetAllCompletedDelegate;
        
        private BeginOperationDelegate onBeginCreateDelegate;
        
        private EndOperationDelegate onEndCreateDelegate;
        
        private System.Threading.SendOrPostCallback onCreateCompletedDelegate;
        
        private BeginOperationDelegate onBeginMarkCompleteDelegate;
        
        private EndOperationDelegate onEndMarkCompleteDelegate;
        
        private System.Threading.SendOrPostCallback onMarkCompleteCompletedDelegate;
        
        private BeginOperationDelegate onBeginDeleteDelegate;
        
        private EndOperationDelegate onEndDeleteDelegate;
        
        private System.Threading.SendOrPostCallback onDeleteCompletedDelegate;
        
        private BeginOperationDelegate onBeginOpenDelegate;
        
        private EndOperationDelegate onEndOpenDelegate;
        
        private System.Threading.SendOrPostCallback onOpenCompletedDelegate;
        
        private BeginOperationDelegate onBeginCloseDelegate;
        
        private EndOperationDelegate onEndCloseDelegate;
        
        private System.Threading.SendOrPostCallback onCloseCompletedDelegate;
        
        public TaskServiceClient() {
        }
        
        public TaskServiceClient(string endpointConfigurationName) : 
                base(endpointConfigurationName) {
        }
        
        public TaskServiceClient(string endpointConfigurationName, string remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
        
        public TaskServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
        
        public TaskServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(binding, remoteAddress) {
        }
        
        public System.Net.CookieContainer CookieContainer {
            get {
                System.ServiceModel.Channels.IHttpCookieContainerManager httpCookieContainerManager = this.InnerChannel.GetProperty<System.ServiceModel.Channels.IHttpCookieContainerManager>();
                if ((httpCookieContainerManager != null)) {
                    return httpCookieContainerManager.CookieContainer;
                }
                else {
                    return null;
                }
            }
            set {
                System.ServiceModel.Channels.IHttpCookieContainerManager httpCookieContainerManager = this.InnerChannel.GetProperty<System.ServiceModel.Channels.IHttpCookieContainerManager>();
                if ((httpCookieContainerManager != null)) {
                    httpCookieContainerManager.CookieContainer = value;
                }
                else {
                    throw new System.InvalidOperationException("Unable to set the CookieContainer. Please make sure the binding contains an HttpC" +
                            "ookieContainerBindingElement.");
                }
            }
        }
        
        public event System.EventHandler<GetAllCompletedEventArgs> GetAllCompleted;
        
        public event System.EventHandler<CreateCompletedEventArgs> CreateCompleted;
        
        public event System.EventHandler<MarkCompleteCompletedEventArgs> MarkCompleteCompleted;
        
        public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> DeleteCompleted;
        
        public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> OpenCompleted;
        
        public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> CloseCompleted;
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        System.IAsyncResult Sample.Silverlight.WCF.Tests.Clumsy.ServiceReference1.ITaskService.BeginGetAll(System.AsyncCallback callback, object asyncState) {
            return base.Channel.BeginGetAll(callback, asyncState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        System.Collections.ObjectModel.ObservableCollection<Sample.Silverlight.WCF.Web.Services.Task> Sample.Silverlight.WCF.Tests.Clumsy.ServiceReference1.ITaskService.EndGetAll(System.IAsyncResult result) {
            return base.Channel.EndGetAll(result);
        }
        
        private System.IAsyncResult OnBeginGetAll(object[] inValues, System.AsyncCallback callback, object asyncState) {
            return ((Sample.Silverlight.WCF.Tests.Clumsy.ServiceReference1.ITaskService)(this)).BeginGetAll(callback, asyncState);
        }
        
        private object[] OnEndGetAll(System.IAsyncResult result) {
            System.Collections.ObjectModel.ObservableCollection<Sample.Silverlight.WCF.Web.Services.Task> retVal = ((Sample.Silverlight.WCF.Tests.Clumsy.ServiceReference1.ITaskService)(this)).EndGetAll(result);
            return new object[] {
                    retVal};
        }
        
        private void OnGetAllCompleted(object state) {
            if ((this.GetAllCompleted != null)) {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.GetAllCompleted(this, new GetAllCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
            }
        }
        
        public void GetAllAsync() {
            this.GetAllAsync(null);
        }
        
        public void GetAllAsync(object userState) {
            if ((this.onBeginGetAllDelegate == null)) {
                this.onBeginGetAllDelegate = new BeginOperationDelegate(this.OnBeginGetAll);
            }
            if ((this.onEndGetAllDelegate == null)) {
                this.onEndGetAllDelegate = new EndOperationDelegate(this.OnEndGetAll);
            }
            if ((this.onGetAllCompletedDelegate == null)) {
                this.onGetAllCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetAllCompleted);
            }
            base.InvokeAsync(this.onBeginGetAllDelegate, null, this.onEndGetAllDelegate, this.onGetAllCompletedDelegate, userState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        System.IAsyncResult Sample.Silverlight.WCF.Tests.Clumsy.ServiceReference1.ITaskService.BeginCreate(string description, System.AsyncCallback callback, object asyncState) {
            return base.Channel.BeginCreate(description, callback, asyncState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        Sample.Silverlight.WCF.Web.Services.Task Sample.Silverlight.WCF.Tests.Clumsy.ServiceReference1.ITaskService.EndCreate(System.IAsyncResult result) {
            return base.Channel.EndCreate(result);
        }
        
        private System.IAsyncResult OnBeginCreate(object[] inValues, System.AsyncCallback callback, object asyncState) {
            string description = ((string)(inValues[0]));
            return ((Sample.Silverlight.WCF.Tests.Clumsy.ServiceReference1.ITaskService)(this)).BeginCreate(description, callback, asyncState);
        }
        
        private object[] OnEndCreate(System.IAsyncResult result) {
            Sample.Silverlight.WCF.Web.Services.Task retVal = ((Sample.Silverlight.WCF.Tests.Clumsy.ServiceReference1.ITaskService)(this)).EndCreate(result);
            return new object[] {
                    retVal};
        }
        
        private void OnCreateCompleted(object state) {
            if ((this.CreateCompleted != null)) {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.CreateCompleted(this, new CreateCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
            }
        }
        
        public void CreateAsync(string description) {
            this.CreateAsync(description, null);
        }
        
        public void CreateAsync(string description, object userState) {
            if ((this.onBeginCreateDelegate == null)) {
                this.onBeginCreateDelegate = new BeginOperationDelegate(this.OnBeginCreate);
            }
            if ((this.onEndCreateDelegate == null)) {
                this.onEndCreateDelegate = new EndOperationDelegate(this.OnEndCreate);
            }
            if ((this.onCreateCompletedDelegate == null)) {
                this.onCreateCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnCreateCompleted);
            }
            base.InvokeAsync(this.onBeginCreateDelegate, new object[] {
                        description}, this.onEndCreateDelegate, this.onCreateCompletedDelegate, userState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        System.IAsyncResult Sample.Silverlight.WCF.Tests.Clumsy.ServiceReference1.ITaskService.BeginMarkComplete(System.Guid id, System.AsyncCallback callback, object asyncState) {
            return base.Channel.BeginMarkComplete(id, callback, asyncState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        Sample.Silverlight.WCF.Web.Services.Task Sample.Silverlight.WCF.Tests.Clumsy.ServiceReference1.ITaskService.EndMarkComplete(System.IAsyncResult result) {
            return base.Channel.EndMarkComplete(result);
        }
        
        private System.IAsyncResult OnBeginMarkComplete(object[] inValues, System.AsyncCallback callback, object asyncState) {
            System.Guid id = ((System.Guid)(inValues[0]));
            return ((Sample.Silverlight.WCF.Tests.Clumsy.ServiceReference1.ITaskService)(this)).BeginMarkComplete(id, callback, asyncState);
        }
        
        private object[] OnEndMarkComplete(System.IAsyncResult result) {
            Sample.Silverlight.WCF.Web.Services.Task retVal = ((Sample.Silverlight.WCF.Tests.Clumsy.ServiceReference1.ITaskService)(this)).EndMarkComplete(result);
            return new object[] {
                    retVal};
        }
        
        private void OnMarkCompleteCompleted(object state) {
            if ((this.MarkCompleteCompleted != null)) {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.MarkCompleteCompleted(this, new MarkCompleteCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
            }
        }
        
        public void MarkCompleteAsync(System.Guid id) {
            this.MarkCompleteAsync(id, null);
        }
        
        public void MarkCompleteAsync(System.Guid id, object userState) {
            if ((this.onBeginMarkCompleteDelegate == null)) {
                this.onBeginMarkCompleteDelegate = new BeginOperationDelegate(this.OnBeginMarkComplete);
            }
            if ((this.onEndMarkCompleteDelegate == null)) {
                this.onEndMarkCompleteDelegate = new EndOperationDelegate(this.OnEndMarkComplete);
            }
            if ((this.onMarkCompleteCompletedDelegate == null)) {
                this.onMarkCompleteCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnMarkCompleteCompleted);
            }
            base.InvokeAsync(this.onBeginMarkCompleteDelegate, new object[] {
                        id}, this.onEndMarkCompleteDelegate, this.onMarkCompleteCompletedDelegate, userState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        System.IAsyncResult Sample.Silverlight.WCF.Tests.Clumsy.ServiceReference1.ITaskService.BeginDelete(System.Guid id, System.AsyncCallback callback, object asyncState) {
            return base.Channel.BeginDelete(id, callback, asyncState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        void Sample.Silverlight.WCF.Tests.Clumsy.ServiceReference1.ITaskService.EndDelete(System.IAsyncResult result) {
            base.Channel.EndDelete(result);
        }
        
        private System.IAsyncResult OnBeginDelete(object[] inValues, System.AsyncCallback callback, object asyncState) {
            System.Guid id = ((System.Guid)(inValues[0]));
            return ((Sample.Silverlight.WCF.Tests.Clumsy.ServiceReference1.ITaskService)(this)).BeginDelete(id, callback, asyncState);
        }
        
        private object[] OnEndDelete(System.IAsyncResult result) {
            ((Sample.Silverlight.WCF.Tests.Clumsy.ServiceReference1.ITaskService)(this)).EndDelete(result);
            return null;
        }
        
        private void OnDeleteCompleted(object state) {
            if ((this.DeleteCompleted != null)) {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.DeleteCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState));
            }
        }
        
        public void DeleteAsync(System.Guid id) {
            this.DeleteAsync(id, null);
        }
        
        public void DeleteAsync(System.Guid id, object userState) {
            if ((this.onBeginDeleteDelegate == null)) {
                this.onBeginDeleteDelegate = new BeginOperationDelegate(this.OnBeginDelete);
            }
            if ((this.onEndDeleteDelegate == null)) {
                this.onEndDeleteDelegate = new EndOperationDelegate(this.OnEndDelete);
            }
            if ((this.onDeleteCompletedDelegate == null)) {
                this.onDeleteCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnDeleteCompleted);
            }
            base.InvokeAsync(this.onBeginDeleteDelegate, new object[] {
                        id}, this.onEndDeleteDelegate, this.onDeleteCompletedDelegate, userState);
        }
        
        private System.IAsyncResult OnBeginOpen(object[] inValues, System.AsyncCallback callback, object asyncState) {
            return ((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(callback, asyncState);
        }
        
        private object[] OnEndOpen(System.IAsyncResult result) {
            ((System.ServiceModel.ICommunicationObject)(this)).EndOpen(result);
            return null;
        }
        
        private void OnOpenCompleted(object state) {
            if ((this.OpenCompleted != null)) {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.OpenCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState));
            }
        }
        
        public void OpenAsync() {
            this.OpenAsync(null);
        }
        
        public void OpenAsync(object userState) {
            if ((this.onBeginOpenDelegate == null)) {
                this.onBeginOpenDelegate = new BeginOperationDelegate(this.OnBeginOpen);
            }
            if ((this.onEndOpenDelegate == null)) {
                this.onEndOpenDelegate = new EndOperationDelegate(this.OnEndOpen);
            }
            if ((this.onOpenCompletedDelegate == null)) {
                this.onOpenCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnOpenCompleted);
            }
            base.InvokeAsync(this.onBeginOpenDelegate, null, this.onEndOpenDelegate, this.onOpenCompletedDelegate, userState);
        }
        
        private System.IAsyncResult OnBeginClose(object[] inValues, System.AsyncCallback callback, object asyncState) {
            return ((System.ServiceModel.ICommunicationObject)(this)).BeginClose(callback, asyncState);
        }
        
        private object[] OnEndClose(System.IAsyncResult result) {
            ((System.ServiceModel.ICommunicationObject)(this)).EndClose(result);
            return null;
        }
        
        private void OnCloseCompleted(object state) {
            if ((this.CloseCompleted != null)) {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.CloseCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState));
            }
        }
        
        public void CloseAsync() {
            this.CloseAsync(null);
        }
        
        public void CloseAsync(object userState) {
            if ((this.onBeginCloseDelegate == null)) {
                this.onBeginCloseDelegate = new BeginOperationDelegate(this.OnBeginClose);
            }
            if ((this.onEndCloseDelegate == null)) {
                this.onEndCloseDelegate = new EndOperationDelegate(this.OnEndClose);
            }
            if ((this.onCloseCompletedDelegate == null)) {
                this.onCloseCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnCloseCompleted);
            }
            base.InvokeAsync(this.onBeginCloseDelegate, null, this.onEndCloseDelegate, this.onCloseCompletedDelegate, userState);
        }
        
        protected override Sample.Silverlight.WCF.Tests.Clumsy.ServiceReference1.ITaskService CreateChannel() {
            return new TaskServiceClientChannel(this);
        }
        
        private class TaskServiceClientChannel : ChannelBase<Sample.Silverlight.WCF.Tests.Clumsy.ServiceReference1.ITaskService>, Sample.Silverlight.WCF.Tests.Clumsy.ServiceReference1.ITaskService {
            
            public TaskServiceClientChannel(System.ServiceModel.ClientBase<Sample.Silverlight.WCF.Tests.Clumsy.ServiceReference1.ITaskService> client) : 
                    base(client) {
            }
            
            public System.IAsyncResult BeginGetAll(System.AsyncCallback callback, object asyncState) {
                object[] _args = new object[0];
                System.IAsyncResult _result = base.BeginInvoke("GetAll", _args, callback, asyncState);
                return _result;
            }
            
            public System.Collections.ObjectModel.ObservableCollection<Sample.Silverlight.WCF.Web.Services.Task> EndGetAll(System.IAsyncResult result) {
                object[] _args = new object[0];
                System.Collections.ObjectModel.ObservableCollection<Sample.Silverlight.WCF.Web.Services.Task> _result = ((System.Collections.ObjectModel.ObservableCollection<Sample.Silverlight.WCF.Web.Services.Task>)(base.EndInvoke("GetAll", _args, result)));
                return _result;
            }
            
            public System.IAsyncResult BeginCreate(string description, System.AsyncCallback callback, object asyncState) {
                object[] _args = new object[1];
                _args[0] = description;
                System.IAsyncResult _result = base.BeginInvoke("Create", _args, callback, asyncState);
                return _result;
            }
            
            public Sample.Silverlight.WCF.Web.Services.Task EndCreate(System.IAsyncResult result) {
                object[] _args = new object[0];
                Sample.Silverlight.WCF.Web.Services.Task _result = ((Sample.Silverlight.WCF.Web.Services.Task)(base.EndInvoke("Create", _args, result)));
                return _result;
            }
            
            public System.IAsyncResult BeginMarkComplete(System.Guid id, System.AsyncCallback callback, object asyncState) {
                object[] _args = new object[1];
                _args[0] = id;
                System.IAsyncResult _result = base.BeginInvoke("MarkComplete", _args, callback, asyncState);
                return _result;
            }
            
            public Sample.Silverlight.WCF.Web.Services.Task EndMarkComplete(System.IAsyncResult result) {
                object[] _args = new object[0];
                Sample.Silverlight.WCF.Web.Services.Task _result = ((Sample.Silverlight.WCF.Web.Services.Task)(base.EndInvoke("MarkComplete", _args, result)));
                return _result;
            }
            
            public System.IAsyncResult BeginDelete(System.Guid id, System.AsyncCallback callback, object asyncState) {
                object[] _args = new object[1];
                _args[0] = id;
                System.IAsyncResult _result = base.BeginInvoke("Delete", _args, callback, asyncState);
                return _result;
            }
            
            public void EndDelete(System.IAsyncResult result) {
                object[] _args = new object[0];
                base.EndInvoke("Delete", _args, result);
            }
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The MIT License


Written By
Software Developer http://blog.xtalion.com
Ukraine Ukraine
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions