Click here to Skip to main content
15,897,518 members
Articles / General Programming / Exceptions

Best Practice logging pattern for Silverlight application

Rate me:
Please Sign up or sign in to vote.
4.86/5 (7 votes)
28 Apr 2012CPOL3 min read 53.9K   1.9K   17  
Server side logging for Silverlight applications using NLog 2.0
  • Silverlight_Logging_WCF.zip
    • Silverlight_Logging_WCF
      • BusinessAppMVVM
        • BusinessAppMVVM.AppWCFService
        • BusinessAppMVVM.sln
        • BusinessAppMVVM.suo
        • BusinessAppMVVM.Web
        • BusinessAppMVVM
          • App.xaml
          • App.xaml.cs
          • Assets
          • BaseClasses
          • Bin
            • Debug
              • AppManifest.xaml
              • ar
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • bg
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • BusinessAppMVVM.dll
              • BusinessAppMVVM.pdb
              • BusinessAppMVVM.xap
              • ca
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • cs
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • da
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • de
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.ServiceModel.DomainServices.Client.resources.dll
                • System.ServiceModel.DomainServices.Client.Web.resources.dll
                • System.ServiceModel.Web.Extensions.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Navigation.resources.dll
                • System.Windows.Controls.resources.dll
              • el
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • es
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.ServiceModel.DomainServices.Client.resources.dll
                • System.ServiceModel.DomainServices.Client.Web.resources.dll
                • System.ServiceModel.Web.Extensions.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Navigation.resources.dll
                • System.Windows.Controls.resources.dll
              • et
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • eu
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • fi
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • fr
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.ServiceModel.DomainServices.Client.resources.dll
                • System.ServiceModel.DomainServices.Client.Web.resources.dll
                • System.ServiceModel.Web.Extensions.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Navigation.resources.dll
                • System.Windows.Controls.resources.dll
              • he
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • hr
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • hu
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • id
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • it
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.ServiceModel.DomainServices.Client.resources.dll
                • System.ServiceModel.DomainServices.Client.Web.resources.dll
                • System.ServiceModel.Web.Extensions.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Navigation.resources.dll
                • System.Windows.Controls.resources.dll
              • ja
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.ServiceModel.DomainServices.Client.resources.dll
                • System.ServiceModel.DomainServices.Client.Web.resources.dll
                • System.ServiceModel.Web.Extensions.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Navigation.resources.dll
                • System.Windows.Controls.resources.dll
              • ko
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.ServiceModel.DomainServices.Client.resources.dll
                • System.ServiceModel.DomainServices.Client.Web.resources.dll
                • System.ServiceModel.Web.Extensions.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Navigation.resources.dll
                • System.Windows.Controls.resources.dll
              • lt
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • lv
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • ms
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • nl
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • no
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • pl
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • pt
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • pt-BR
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • ro
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • ru
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.ServiceModel.DomainServices.Client.resources.dll
                • System.ServiceModel.DomainServices.Client.Web.resources.dll
                • System.ServiceModel.Web.Extensions.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Navigation.resources.dll
                • System.Windows.Controls.resources.dll
              • sk
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • sl
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • sr-Cyrl-CS
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • sr-Latn-CS
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • sv
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • System.ComponentModel.DataAnnotations.dll
              • System.ComponentModel.DataAnnotations.xml
              • System.ServiceModel.DomainServices.Client.dll
              • System.ServiceModel.DomainServices.Client.Web.dll
              • System.ServiceModel.DomainServices.Client.Web.xml
              • System.ServiceModel.DomainServices.Client.xml
              • System.ServiceModel.Web.Extensions.dll
              • System.ServiceModel.Web.Extensions.xml
              • System.Windows.Controls.Data.DataForm.Toolkit.dll
              • System.Windows.Controls.Data.Input.dll
              • System.Windows.Controls.Data.Input.xml
              • System.Windows.Controls.dll
              • System.Windows.Controls.Navigation.dll
              • System.Windows.Controls.Navigation.xml
              • System.Windows.Controls.xml
              • TestPage.html
              • th
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • tr
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • uk
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • vi
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • zh-Hans
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.ServiceModel.DomainServices.Client.resources.dll
                • System.ServiceModel.DomainServices.Client.Web.resources.dll
                • System.ServiceModel.Web.Extensions.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Navigation.resources.dll
                • System.Windows.Controls.resources.dll
              • zh-Hant
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.ServiceModel.DomainServices.Client.resources.dll
                • System.ServiceModel.DomainServices.Client.Web.resources.dll
                • System.ServiceModel.Web.Extensions.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Navigation.resources.dll
                • System.Windows.Controls.resources.dll
          • BusinessAppMVVM.csproj
          • BusinessAppMVVM.csproj.user
          • Controls
          • Generated_Code
          • GlobalSuppressions.cs
          • Helpers
          • Libs
            • System.Windows.Controls.Data.DataForm.Toolkit.dll
          • MainPage.xaml
          • MainPage.xaml.cs
          • Models
          • obj
          • Properties
          • Service References
          • ServiceReferences.ClientConfig
          • ViewModel
          • Views
          • Web
            • Resources
  • Silverlight_Logging.zip
    • Silverlight_Logging
      • BusinessAppMVVM
        • BusinessAppMVVM.sln
        • BusinessAppMVVM.suo
        • BusinessAppMVVM.Web
        • BusinessAppMVVM
          • App.xaml
          • App.xaml.cs
          • Assets
          • BaseClasses
          • Bin
            • Debug
              • AppManifest.xaml
              • ar
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • bg
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • BusinessAppMVVM.dll
              • BusinessAppMVVM.pdb
              • BusinessAppMVVM.xap
              • ca
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • cs
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • da
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • de
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.ServiceModel.DomainServices.Client.resources.dll
                • System.ServiceModel.DomainServices.Client.Web.resources.dll
                • System.ServiceModel.Web.Extensions.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Navigation.resources.dll
                • System.Windows.Controls.resources.dll
              • el
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • es
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.ServiceModel.DomainServices.Client.resources.dll
                • System.ServiceModel.DomainServices.Client.Web.resources.dll
                • System.ServiceModel.Web.Extensions.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Navigation.resources.dll
                • System.Windows.Controls.resources.dll
              • et
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • eu
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • fi
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • fr
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.ServiceModel.DomainServices.Client.resources.dll
                • System.ServiceModel.DomainServices.Client.Web.resources.dll
                • System.ServiceModel.Web.Extensions.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Navigation.resources.dll
                • System.Windows.Controls.resources.dll
              • he
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • hr
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • hu
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • id
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • it
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.ServiceModel.DomainServices.Client.resources.dll
                • System.ServiceModel.DomainServices.Client.Web.resources.dll
                • System.ServiceModel.Web.Extensions.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Navigation.resources.dll
                • System.Windows.Controls.resources.dll
              • ja
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.ServiceModel.DomainServices.Client.resources.dll
                • System.ServiceModel.DomainServices.Client.Web.resources.dll
                • System.ServiceModel.Web.Extensions.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Navigation.resources.dll
                • System.Windows.Controls.resources.dll
              • ko
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.ServiceModel.DomainServices.Client.resources.dll
                • System.ServiceModel.DomainServices.Client.Web.resources.dll
                • System.ServiceModel.Web.Extensions.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Navigation.resources.dll
                • System.Windows.Controls.resources.dll
              • lt
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • lv
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • ms
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • nl
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • no
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • pl
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • pt
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • pt-BR
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • ro
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • ru
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.ServiceModel.DomainServices.Client.resources.dll
                • System.ServiceModel.DomainServices.Client.Web.resources.dll
                • System.ServiceModel.Web.Extensions.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Navigation.resources.dll
                • System.Windows.Controls.resources.dll
              • sk
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • sl
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • sr-Cyrl-CS
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • sr-Latn-CS
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • sv
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • System.ComponentModel.DataAnnotations.dll
              • System.ComponentModel.DataAnnotations.xml
              • System.ServiceModel.DomainServices.Client.dll
              • System.ServiceModel.DomainServices.Client.Web.dll
              • System.ServiceModel.DomainServices.Client.Web.xml
              • System.ServiceModel.DomainServices.Client.xml
              • System.ServiceModel.Web.Extensions.dll
              • System.ServiceModel.Web.Extensions.xml
              • System.Windows.Controls.Data.DataForm.Toolkit.dll
              • System.Windows.Controls.Data.Input.dll
              • System.Windows.Controls.Data.Input.xml
              • System.Windows.Controls.dll
              • System.Windows.Controls.Navigation.dll
              • System.Windows.Controls.Navigation.xml
              • System.Windows.Controls.xml
              • TestPage.html
              • th
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • tr
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • uk
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • vi
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.resources.dll
              • zh-Hans
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.ServiceModel.DomainServices.Client.resources.dll
                • System.ServiceModel.DomainServices.Client.Web.resources.dll
                • System.ServiceModel.Web.Extensions.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Navigation.resources.dll
                • System.Windows.Controls.resources.dll
              • zh-Hant
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.ServiceModel.DomainServices.Client.resources.dll
                • System.ServiceModel.DomainServices.Client.Web.resources.dll
                • System.ServiceModel.Web.Extensions.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Navigation.resources.dll
                • System.Windows.Controls.resources.dll
          • BusinessAppMVVM.csproj
          • BusinessAppMVVM.csproj.user
          • Controls
          • Generated_Code
          • GlobalSuppressions.cs
          • Helpers
          • Libs
            • System.Windows.Controls.Data.DataForm.Toolkit.dll
          • MainPage.xaml
          • MainPage.xaml.cs
          • Models
          • obj
          • Properties
          • Service References
          • ServiceReferences.ClientConfig
          • ViewModel
          • Views
          • Web
            • Resources
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.239
//
//     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 5.0.61118.0
// 
namespace BusinessAppMVVM.BusinessAppServiceModel {
    using System.Runtime.Serialization;
    
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Name="CompositeType", Namespace="http://schemas.datacontract.org/2004/07/BusinessAppMVVM.AppWCFService")]
    public partial class CompositeType : object, System.ComponentModel.INotifyPropertyChanged {
        
        private bool BoolValueField;
        
        private string StringValueField;
        
        [System.Runtime.Serialization.DataMemberAttribute()]
        public bool BoolValue {
            get {
                return this.BoolValueField;
            }
            set {
                if ((this.BoolValueField.Equals(value) != true)) {
                    this.BoolValueField = value;
                    this.RaisePropertyChanged("BoolValue");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute()]
        public string StringValue {
            get {
                return this.StringValueField;
            }
            set {
                if ((object.ReferenceEquals(this.StringValueField, value) != true)) {
                    this.StringValueField = value;
                    this.RaisePropertyChanged("StringValue");
                }
            }
        }
        
        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
        
        protected void RaisePropertyChanged(string propertyName) {
            System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
            if ((propertyChanged != null)) {
                propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
            }
        }
    }
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ServiceModel.ServiceContractAttribute(ConfigurationName="BusinessAppServiceModel.IService1")]
    public interface IService1 {
        
        [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IService1/GetData", ReplyAction="http://tempuri.org/IService1/GetDataResponse")]
        System.IAsyncResult BeginGetData(int value, System.AsyncCallback callback, object asyncState);
        
        string EndGetData(System.IAsyncResult result);
        
        [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IService1/GetDataUsingDataContract", ReplyAction="http://tempuri.org/IService1/GetDataUsingDataContractResponse")]
        System.IAsyncResult BeginGetDataUsingDataContract(BusinessAppMVVM.BusinessAppServiceModel.CompositeType composite, System.AsyncCallback callback, object asyncState);
        
        BusinessAppMVVM.BusinessAppServiceModel.CompositeType EndGetDataUsingDataContract(System.IAsyncResult result);
        
        [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IService1/GetUserAddress", ReplyAction="http://tempuri.org/IService1/GetUserAddressResponse")]
        System.IAsyncResult BeginGetUserAddress(string value, System.AsyncCallback callback, object asyncState);
        
        string EndGetUserAddress(System.IAsyncResult result);
    }
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public interface IService1Channel : BusinessAppMVVM.BusinessAppServiceModel.IService1, System.ServiceModel.IClientChannel {
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public partial class GetDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        public GetDataCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        public string Result {
            get {
                base.RaiseExceptionIfNecessary();
                return ((string)(this.results[0]));
            }
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public partial class GetDataUsingDataContractCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        public GetDataUsingDataContractCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        public BusinessAppMVVM.BusinessAppServiceModel.CompositeType Result {
            get {
                base.RaiseExceptionIfNecessary();
                return ((BusinessAppMVVM.BusinessAppServiceModel.CompositeType)(this.results[0]));
            }
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public partial class GetUserAddressCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        public GetUserAddressCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        public string Result {
            get {
                base.RaiseExceptionIfNecessary();
                return ((string)(this.results[0]));
            }
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public partial class Service1Client : System.ServiceModel.ClientBase<BusinessAppMVVM.BusinessAppServiceModel.IService1>, BusinessAppMVVM.BusinessAppServiceModel.IService1 {
        
        private BeginOperationDelegate onBeginGetDataDelegate;
        
        private EndOperationDelegate onEndGetDataDelegate;
        
        private System.Threading.SendOrPostCallback onGetDataCompletedDelegate;
        
        private BeginOperationDelegate onBeginGetDataUsingDataContractDelegate;
        
        private EndOperationDelegate onEndGetDataUsingDataContractDelegate;
        
        private System.Threading.SendOrPostCallback onGetDataUsingDataContractCompletedDelegate;
        
        private BeginOperationDelegate onBeginGetUserAddressDelegate;
        
        private EndOperationDelegate onEndGetUserAddressDelegate;
        
        private System.Threading.SendOrPostCallback onGetUserAddressCompletedDelegate;
        
        private BeginOperationDelegate onBeginOpenDelegate;
        
        private EndOperationDelegate onEndOpenDelegate;
        
        private System.Threading.SendOrPostCallback onOpenCompletedDelegate;
        
        private BeginOperationDelegate onBeginCloseDelegate;
        
        private EndOperationDelegate onEndCloseDelegate;
        
        private System.Threading.SendOrPostCallback onCloseCompletedDelegate;
        
        public Service1Client() {
        }
        
        public Service1Client(string endpointConfigurationName) : 
                base(endpointConfigurationName) {
        }
        
        public Service1Client(string endpointConfigurationName, string remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
        
        public Service1Client(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
        
        public Service1Client(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<GetDataCompletedEventArgs> GetDataCompleted;
        
        public event System.EventHandler<GetDataUsingDataContractCompletedEventArgs> GetDataUsingDataContractCompleted;
        
        public event System.EventHandler<GetUserAddressCompletedEventArgs> GetUserAddressCompleted;
        
        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 BusinessAppMVVM.BusinessAppServiceModel.IService1.BeginGetData(int value, System.AsyncCallback callback, object asyncState) {
            return base.Channel.BeginGetData(value, callback, asyncState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        string BusinessAppMVVM.BusinessAppServiceModel.IService1.EndGetData(System.IAsyncResult result) {
            return base.Channel.EndGetData(result);
        }
        
        private System.IAsyncResult OnBeginGetData(object[] inValues, System.AsyncCallback callback, object asyncState) {
            int value = ((int)(inValues[0]));
            return ((BusinessAppMVVM.BusinessAppServiceModel.IService1)(this)).BeginGetData(value, callback, asyncState);
        }
        
        private object[] OnEndGetData(System.IAsyncResult result) {
            string retVal = ((BusinessAppMVVM.BusinessAppServiceModel.IService1)(this)).EndGetData(result);
            return new object[] {
                    retVal};
        }
        
        private void OnGetDataCompleted(object state) {
            if ((this.GetDataCompleted != null)) {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.GetDataCompleted(this, new GetDataCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
            }
        }
        
        public void GetDataAsync(int value) {
            this.GetDataAsync(value, null);
        }
        
        public void GetDataAsync(int value, object userState) {
            if ((this.onBeginGetDataDelegate == null)) {
                this.onBeginGetDataDelegate = new BeginOperationDelegate(this.OnBeginGetData);
            }
            if ((this.onEndGetDataDelegate == null)) {
                this.onEndGetDataDelegate = new EndOperationDelegate(this.OnEndGetData);
            }
            if ((this.onGetDataCompletedDelegate == null)) {
                this.onGetDataCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetDataCompleted);
            }
            base.InvokeAsync(this.onBeginGetDataDelegate, new object[] {
                        value}, this.onEndGetDataDelegate, this.onGetDataCompletedDelegate, userState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        System.IAsyncResult BusinessAppMVVM.BusinessAppServiceModel.IService1.BeginGetDataUsingDataContract(BusinessAppMVVM.BusinessAppServiceModel.CompositeType composite, System.AsyncCallback callback, object asyncState) {
            return base.Channel.BeginGetDataUsingDataContract(composite, callback, asyncState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        BusinessAppMVVM.BusinessAppServiceModel.CompositeType BusinessAppMVVM.BusinessAppServiceModel.IService1.EndGetDataUsingDataContract(System.IAsyncResult result) {
            return base.Channel.EndGetDataUsingDataContract(result);
        }
        
        private System.IAsyncResult OnBeginGetDataUsingDataContract(object[] inValues, System.AsyncCallback callback, object asyncState) {
            BusinessAppMVVM.BusinessAppServiceModel.CompositeType composite = ((BusinessAppMVVM.BusinessAppServiceModel.CompositeType)(inValues[0]));
            return ((BusinessAppMVVM.BusinessAppServiceModel.IService1)(this)).BeginGetDataUsingDataContract(composite, callback, asyncState);
        }
        
        private object[] OnEndGetDataUsingDataContract(System.IAsyncResult result) {
            BusinessAppMVVM.BusinessAppServiceModel.CompositeType retVal = ((BusinessAppMVVM.BusinessAppServiceModel.IService1)(this)).EndGetDataUsingDataContract(result);
            return new object[] {
                    retVal};
        }
        
        private void OnGetDataUsingDataContractCompleted(object state) {
            if ((this.GetDataUsingDataContractCompleted != null)) {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.GetDataUsingDataContractCompleted(this, new GetDataUsingDataContractCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
            }
        }
        
        public void GetDataUsingDataContractAsync(BusinessAppMVVM.BusinessAppServiceModel.CompositeType composite) {
            this.GetDataUsingDataContractAsync(composite, null);
        }
        
        public void GetDataUsingDataContractAsync(BusinessAppMVVM.BusinessAppServiceModel.CompositeType composite, object userState) {
            if ((this.onBeginGetDataUsingDataContractDelegate == null)) {
                this.onBeginGetDataUsingDataContractDelegate = new BeginOperationDelegate(this.OnBeginGetDataUsingDataContract);
            }
            if ((this.onEndGetDataUsingDataContractDelegate == null)) {
                this.onEndGetDataUsingDataContractDelegate = new EndOperationDelegate(this.OnEndGetDataUsingDataContract);
            }
            if ((this.onGetDataUsingDataContractCompletedDelegate == null)) {
                this.onGetDataUsingDataContractCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetDataUsingDataContractCompleted);
            }
            base.InvokeAsync(this.onBeginGetDataUsingDataContractDelegate, new object[] {
                        composite}, this.onEndGetDataUsingDataContractDelegate, this.onGetDataUsingDataContractCompletedDelegate, userState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        System.IAsyncResult BusinessAppMVVM.BusinessAppServiceModel.IService1.BeginGetUserAddress(string value, System.AsyncCallback callback, object asyncState) {
            return base.Channel.BeginGetUserAddress(value, callback, asyncState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        string BusinessAppMVVM.BusinessAppServiceModel.IService1.EndGetUserAddress(System.IAsyncResult result) {
            return base.Channel.EndGetUserAddress(result);
        }
        
        private System.IAsyncResult OnBeginGetUserAddress(object[] inValues, System.AsyncCallback callback, object asyncState) {
            string value = ((string)(inValues[0]));
            return ((BusinessAppMVVM.BusinessAppServiceModel.IService1)(this)).BeginGetUserAddress(value, callback, asyncState);
        }
        
        private object[] OnEndGetUserAddress(System.IAsyncResult result) {
            string retVal = ((BusinessAppMVVM.BusinessAppServiceModel.IService1)(this)).EndGetUserAddress(result);
            return new object[] {
                    retVal};
        }
        
        private void OnGetUserAddressCompleted(object state) {
            if ((this.GetUserAddressCompleted != null)) {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.GetUserAddressCompleted(this, new GetUserAddressCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
            }
        }
        
        public void GetUserAddressAsync(string value) {
            this.GetUserAddressAsync(value, null);
        }
        
        public void GetUserAddressAsync(string value, object userState) {
            if ((this.onBeginGetUserAddressDelegate == null)) {
                this.onBeginGetUserAddressDelegate = new BeginOperationDelegate(this.OnBeginGetUserAddress);
            }
            if ((this.onEndGetUserAddressDelegate == null)) {
                this.onEndGetUserAddressDelegate = new EndOperationDelegate(this.OnEndGetUserAddress);
            }
            if ((this.onGetUserAddressCompletedDelegate == null)) {
                this.onGetUserAddressCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetUserAddressCompleted);
            }
            base.InvokeAsync(this.onBeginGetUserAddressDelegate, new object[] {
                        value}, this.onEndGetUserAddressDelegate, this.onGetUserAddressCompletedDelegate, 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 BusinessAppMVVM.BusinessAppServiceModel.IService1 CreateChannel() {
            return new Service1ClientChannel(this);
        }
        
        private class Service1ClientChannel : ChannelBase<BusinessAppMVVM.BusinessAppServiceModel.IService1>, BusinessAppMVVM.BusinessAppServiceModel.IService1 {
            
            public Service1ClientChannel(System.ServiceModel.ClientBase<BusinessAppMVVM.BusinessAppServiceModel.IService1> client) : 
                    base(client) {
            }
            
            public System.IAsyncResult BeginGetData(int value, System.AsyncCallback callback, object asyncState) {
                object[] _args = new object[1];
                _args[0] = value;
                System.IAsyncResult _result = base.BeginInvoke("GetData", _args, callback, asyncState);
                return _result;
            }
            
            public string EndGetData(System.IAsyncResult result) {
                object[] _args = new object[0];
                string _result = ((string)(base.EndInvoke("GetData", _args, result)));
                return _result;
            }
            
            public System.IAsyncResult BeginGetDataUsingDataContract(BusinessAppMVVM.BusinessAppServiceModel.CompositeType composite, System.AsyncCallback callback, object asyncState) {
                object[] _args = new object[1];
                _args[0] = composite;
                System.IAsyncResult _result = base.BeginInvoke("GetDataUsingDataContract", _args, callback, asyncState);
                return _result;
            }
            
            public BusinessAppMVVM.BusinessAppServiceModel.CompositeType EndGetDataUsingDataContract(System.IAsyncResult result) {
                object[] _args = new object[0];
                BusinessAppMVVM.BusinessAppServiceModel.CompositeType _result = ((BusinessAppMVVM.BusinessAppServiceModel.CompositeType)(base.EndInvoke("GetDataUsingDataContract", _args, result)));
                return _result;
            }
            
            public System.IAsyncResult BeginGetUserAddress(string value, System.AsyncCallback callback, object asyncState) {
                object[] _args = new object[1];
                _args[0] = value;
                System.IAsyncResult _result = base.BeginInvoke("GetUserAddress", _args, callback, asyncState);
                return _result;
            }
            
            public string EndGetUserAddress(System.IAsyncResult result) {
                object[] _args = new object[0];
                string _result = ((string)(base.EndInvoke("GetUserAddress", _args, result)));
                return _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 Code Project Open License (CPOL)


Written By
Architect
United States United States
Manoj Kumar

AWS Certified Solutions Architect (Web development, Serverless, DevOps, Data)
MSSE - Cloud and Mobile Computing, San Jose State University

A wide range of experience in resolving complex business problems.

* Cloud Technologies: EC2, S3, DynamoDB & RDS databases, Lambda serverless architecture, Microservices architecture, API Gateway, Cloud Front CDN, Linux/Windows systems administration, CloudFormation, DevOps, Docker, CICD, Node.js, Python, Java and other open source technologies. Familiarity with OpenStack.
* Web Technologies: HTML5, Node.Js, MEAN Stack, AngularJS, ASP.Net Core, MVC5, CSS3, jQuery, Bootstrap, MongoDB, JavaScript, JSON, AJAX.
* Data: Experience in database architecture, Big Data, Machine Learning, BI, Data Analytics, No-SQL databases, ETL.
* Mobile: IOS/Android app development

He lives with his wife Supriya and daughter Tisya in Bay Area.

Comments and Discussions