Windows Workflow Foundation (WF4) - Workflow Services and Auto-Start

This sample application demonstrates how you can create a Workflow Service that will automatically start and periodically wake up to do some work. The sample also demonstrates a UI that shows the progress of the work and provides control and query capabilities.

C# (249.0 KB)
 
 
 
 
 
4 Star
(6)
4,298 times
Add to favorites
4/28/2011
E-mail Twitter del.icio.us Digg Facebook
//------------------------------------------------------------------------------
// <auto-generated>
//    This code was generated from a template.
//
//    Manual changes to this file may cause unexpected behavior in your application.
//    Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Data.Objects;
using System.Data.Objects.DataClasses;
using System.Data.EntityClient;
using System.ComponentModel;
using System.Xml.Serialization;
using System.Runtime.Serialization;

[assembly: EdmSchemaAttribute()]

namespace BatchWeb
{
    #region Contexts
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    public partial class AppFabricMonitoringDBEntities : ObjectContext
    {
        #region Constructors
    
        /// <summary>
        /// Initializes a new AppFabricMonitoringDBEntities object using the connection string found in the 'AppFabricMonitoringDBEntities' section of the application configuration file.
        /// </summary>
        public AppFabricMonitoringDBEntities() : base("name=AppFabricMonitoringDBEntities", "AppFabricMonitoringDBEntities")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }
    
        /// <summary>
        /// Initialize a new AppFabricMonitoringDBEntities object.
        /// </summary>
        public AppFabricMonitoringDBEntities(string connectionString) : base(connectionString, "AppFabricMonitoringDBEntities")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }
    
        /// <summary>
        /// Initialize a new AppFabricMonitoringDBEntities object.
        /// </summary>
        public AppFabricMonitoringDBEntities(EntityConnection connection) : base(connection, "AppFabricMonitoringDBEntities")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }
    
        #endregion
    
        #region Partial Methods
    
        partial void OnContextCreated();
    
        #endregion
    
        #region ObjectSet Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<ASWfEvent> ASWfEvents
        {
            get
            {
                if ((_ASWfEvents == null))
                {
                    _ASWfEvents = base.CreateObjectSet<ASWfEvent>("ASWfEvents");
                }
                return _ASWfEvents;
            }
        }
        private ObjectSet<ASWfEvent> _ASWfEvents;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<ASWfInstance> ASWfInstances
        {
            get
            {
                if ((_ASWfInstances == null))
                {
                    _ASWfInstances = base.CreateObjectSet<ASWfInstance>("ASWfInstances");
                }
                return _ASWfInstances;
            }
        }
        private ObjectSet<ASWfInstance> _ASWfInstances;

        #endregion
        #region AddTo Methods
    
        /// <summary>
        /// Deprecated Method for adding a new object to the ASWfEvents EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToASWfEvents(ASWfEvent aSWfEvent)
        {
            base.AddObject("ASWfEvents", aSWfEvent);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the ASWfInstances EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToASWfInstances(ASWfInstance aSWfInstance)
        {
            base.AddObject("ASWfInstances", aSWfInstance);
        }

        #endregion
    }
    

    #endregion
    
    #region Entities
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AppFabricMonitoringDBModel", Name="ASWfEvent")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class ASWfEvent : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new ASWfEvent object.
        /// </summary>
        /// <param name="id">Initial value of the Id property.</param>
        /// <param name="eventTypeId">Initial value of the EventTypeId property.</param>
        /// <param name="eventVersion">Initial value of the EventVersion property.</param>
        /// <param name="eventSourceId">Initial value of the EventSourceId property.</param>
        /// <param name="processId">Initial value of the ProcessId property.</param>
        /// <param name="traceLevelId">Initial value of the TraceLevelId property.</param>
        /// <param name="timeCreated">Initial value of the TimeCreated property.</param>
        public static ASWfEvent CreateASWfEvent(global::System.Int64 id, global::System.Int32 eventTypeId, global::System.Int32 eventVersion, global::System.Int32 eventSourceId, global::System.Int32 processId, global::System.Byte traceLevelId, global::System.DateTime timeCreated)
        {
            ASWfEvent aSWfEvent = new ASWfEvent();
            aSWfEvent.Id = id;
            aSWfEvent.EventTypeId = eventTypeId;
            aSWfEvent.EventVersion = eventVersion;
            aSWfEvent.EventSourceId = eventSourceId;
            aSWfEvent.ProcessId = processId;
            aSWfEvent.TraceLevelId = traceLevelId;
            aSWfEvent.TimeCreated = timeCreated;
            return aSWfEvent;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int64 Id
        {
            get
            {
                return _Id;
            }
            set
            {
                if (_Id != value)
                {
                    OnIdChanging(value);
                    ReportPropertyChanging("Id");
                    _Id = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("Id");
                    OnIdChanged();
                }
            }
        }
        private global::System.Int64 _Id;
        partial void OnIdChanging(global::System.Int64 value);
        partial void OnIdChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 EventTypeId
        {
            get
            {
                return _EventTypeId;
            }
            set
            {
                if (_EventTypeId != value)
                {
                    OnEventTypeIdChanging(value);
                    ReportPropertyChanging("EventTypeId");
                    _EventTypeId = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("EventTypeId");
                    OnEventTypeIdChanged();
                }
            }
        }
        private global::System.Int32 _EventTypeId;
        partial void OnEventTypeIdChanging(global::System.Int32 value);
        partial void OnEventTypeIdChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String EventType
        {
            get
            {
                return _EventType;
            }
            set
            {
                OnEventTypeChanging(value);
                ReportPropertyChanging("EventType");
                _EventType = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("EventType");
                OnEventTypeChanged();
            }
        }
        private global::System.String _EventType;
        partial void OnEventTypeChanging(global::System.String value);
        partial void OnEventTypeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 EventVersion
        {
            get
            {
                return _EventVersion;
            }
            set
            {
                if (_EventVersion != value)
                {
                    OnEventVersionChanging(value);
                    ReportPropertyChanging("EventVersion");
                    _EventVersion = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("EventVersion");
                    OnEventVersionChanged();
                }
            }
        }
        private global::System.Int32 _EventVersion;
        partial void OnEventVersionChanging(global::System.Int32 value);
        partial void OnEventVersionChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 EventSourceId
        {
            get
            {
                return _EventSourceId;
            }
            set
            {
                if (_EventSourceId != value)
                {
                    OnEventSourceIdChanging(value);
                    ReportPropertyChanging("EventSourceId");
                    _EventSourceId = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("EventSourceId");
                    OnEventSourceIdChanged();
                }
            }
        }
        private global::System.Int32 _EventSourceId;
        partial void OnEventSourceIdChanging(global::System.Int32 value);
        partial void OnEventSourceIdChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ProcessId
        {
            get
            {
                return _ProcessId;
            }
            set
            {
                if (_ProcessId != value)
                {
                    OnProcessIdChanging(value);
                    ReportPropertyChanging("ProcessId");
                    _ProcessId = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ProcessId");
                    OnProcessIdChanged();
                }
            }
        }
        private global::System.Int32 _ProcessId;
        partial void OnProcessIdChanging(global::System.Int32 value);
        partial void OnProcessIdChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String WorkflowInstanceId
        {
            get
            {
                return _WorkflowInstanceId;
            }
            set
            {
                OnWorkflowInstanceIdChanging(value);
                ReportPropertyChanging("WorkflowInstanceId");
                _WorkflowInstanceId = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("WorkflowInstanceId");
                OnWorkflowInstanceIdChanged();
            }
        }
        private global::System.String _WorkflowInstanceId;
        partial void OnWorkflowInstanceIdChanging(global::System.String value);
        partial void OnWorkflowInstanceIdChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> TrackingProfileId
        {
            get
            {
                return _TrackingProfileId;
            }
            set
            {
                OnTrackingProfileIdChanging(value);
                ReportPropertyChanging("TrackingProfileId");
                _TrackingProfileId = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("TrackingProfileId");
                OnTrackingProfileIdChanged();
            }
        }
        private Nullable<global::System.Int32> _TrackingProfileId;
        partial void OnTrackingProfileIdChanging(Nullable<global::System.Int32> value);
        partial void OnTrackingProfileIdChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String E2EActivityId
        {
            get
            {
                return _E2EActivityId;
            }
            set
            {
                OnE2EActivityIdChanging(value);
                ReportPropertyChanging("E2EActivityId");
                _E2EActivityId = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("E2EActivityId");
                OnE2EActivityIdChanged();
            }
        }
        private global::System.String _E2EActivityId;
        partial void OnE2EActivityIdChanging(global::System.String value);
        partial void OnE2EActivityIdChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Byte TraceLevelId
        {
            get
            {
                return _TraceLevelId;
            }
            set
            {
                if (_TraceLevelId != value)
                {
                    OnTraceLevelIdChanging(value);
                    ReportPropertyChanging("TraceLevelId");
                    _TraceLevelId = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("TraceLevelId");
                    OnTraceLevelIdChanged();
                }
            }
        }
        private global::System.Byte _TraceLevelId;
        partial void OnTraceLevelIdChanging(global::System.Byte value);
        partial void OnTraceLevelIdChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String TraceLevel
        {
            get
            {
                return _TraceLevel;
            }
            set
            {
                OnTraceLevelChanging(value);
                ReportPropertyChanging("TraceLevel");
                _TraceLevel = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("TraceLevel");
                OnTraceLevelChanged();
            }
        }
        private global::System.String _TraceLevel;
        partial void OnTraceLevelChanging(global::System.String value);
        partial void OnTraceLevelChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int64> RecordNumber
        {
            get
            {
                return _RecordNumber;
            }
            set
            {
                OnRecordNumberChanging(value);
                ReportPropertyChanging("RecordNumber");
                _RecordNumber = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("RecordNumber");
                OnRecordNumberChanged();
            }
        }
        private Nullable<global::System.Int64> _RecordNumber;
        partial void OnRecordNumberChanging(Nullable<global::System.Int64> value);
        partial void OnRecordNumberChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> AnnotationSetId
        {
            get
            {
                return _AnnotationSetId;
            }
            set
            {
                OnAnnotationSetIdChanging(value);
                ReportPropertyChanging("AnnotationSetId");
                _AnnotationSetId = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("AnnotationSetId");
                OnAnnotationSetIdChanged();
            }
        }
        private Nullable<global::System.Int32> _AnnotationSetId;
        partial void OnAnnotationSetIdChanging(Nullable<global::System.Int32> value);
        partial void OnAnnotationSetIdChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime TimeCreated
        {
            get
            {
                return _TimeCreated;
            }
            set
            {
                if (_TimeCreated != value)
                {
                    OnTimeCreatedChanging(value);
                    ReportPropertyChanging("TimeCreated");
                    _TimeCreated = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("TimeCreated");
                    OnTimeCreatedChanged();
                }
            }
        }
        private global::System.DateTime _TimeCreated;
        partial void OnTimeCreatedChanging(global::System.DateTime value);
        partial void OnTimeCreatedChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String ActivityName
        {
            get
            {
                return _ActivityName;
            }
            set
            {
                OnActivityNameChanging(value);
                ReportPropertyChanging("ActivityName");
                _ActivityName = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("ActivityName");
                OnActivityNameChanged();
            }
        }
        private global::System.String _ActivityName;
        partial void OnActivityNameChanging(global::System.String value);
        partial void OnActivityNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String ActivityId
        {
            get
            {
                return _ActivityId;
            }
            set
            {
                OnActivityIdChanging(value);
                ReportPropertyChanging("ActivityId");
                _ActivityId = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("ActivityId");
                OnActivityIdChanged();
            }
        }
        private global::System.String _ActivityId;
        partial void OnActivityIdChanging(global::System.String value);
        partial void OnActivityIdChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String ActivityInstanceId
        {
            get
            {
                return _ActivityInstanceId;
            }
            set
            {
                OnActivityInstanceIdChanging(value);
                ReportPropertyChanging("ActivityInstanceId");
                _ActivityInstanceId = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("ActivityInstanceId");
                OnActivityInstanceIdChanged();
            }
        }
        private global::System.String _ActivityInstanceId;
        partial void OnActivityInstanceIdChanging(global::System.String value);
        partial void OnActivityInstanceIdChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String ActivityRootId
        {
            get
            {
                return _ActivityRootId;
            }
            set
            {
                OnActivityRootIdChanging(value);
                ReportPropertyChanging("ActivityRootId");
                _ActivityRootId = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("ActivityRootId");
                OnActivityRootIdChanged();
            }
        }
        private global::System.String _ActivityRootId;
        partial void OnActivityRootIdChanging(global::System.String value);
        partial void OnActivityRootIdChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String ActivityTypeName
        {
            get
            {
                return _ActivityTypeName;
            }
            set
            {
                OnActivityTypeNameChanging(value);
                ReportPropertyChanging("ActivityTypeName");
                _ActivityTypeName = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("ActivityTypeName");
                OnActivityTypeNameChanged();
            }
        }
        private global::System.String _ActivityTypeName;
        partial void OnActivityTypeNameChanging(global::System.String value);
        partial void OnActivityTypeNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String CustomRecordName
        {
            get
            {
                return _CustomRecordName;
            }
            set
            {
                OnCustomRecordNameChanging(value);
                ReportPropertyChanging("CustomRecordName");
                _CustomRecordName = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("CustomRecordName");
                OnCustomRecordNameChanged();
            }
        }
        private global::System.String _CustomRecordName;
        partial void OnCustomRecordNameChanging(global::System.String value);
        partial void OnCustomRecordNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String SourceName
        {
            get
            {
                return _SourceName;
            }
            set
            {
                OnSourceNameChanging(value);
                ReportPropertyChanging("SourceName");
                _SourceName = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("SourceName");
                OnSourceNameChanged();
            }
        }
        private global::System.String _SourceName;
        partial void OnSourceNameChanging(global::System.String value);
        partial void OnSourceNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String SourceId
        {
            get
            {
                return _SourceId;
            }
            set
            {
                OnSourceIdChanging(value);
                ReportPropertyChanging("SourceId");
                _SourceId = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("SourceId");
                OnSourceIdChanged();
            }
        }
        private global::System.String _SourceId;
        partial void OnSourceIdChanging(global::System.String value);
        partial void OnSourceIdChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String SourceInstanceId
        {
            get
            {
                return _SourceInstanceId;
            }
            set
            {
                OnSourceInstanceIdChanging(value);
                ReportPropertyChanging("SourceInstanceId");
                _SourceInstanceId = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("SourceInstanceId");
                OnSourceInstanceIdChanged();
            }
        }
        private global::System.String _SourceInstanceId;
        partial void OnSourceInstanceIdChanging(global::System.String value);
        partial void OnSourceInstanceIdChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String SourceTypeName
        {
            get
            {
                return _SourceTypeName;
            }
            set
            {
                OnSourceTypeNameChanging(value);
                ReportPropertyChanging("SourceTypeName");
                _SourceTypeName = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("SourceTypeName");
                OnSourceTypeNameChanged();
            }
        }
        private global::System.String _SourceTypeName;
        partial void OnSourceTypeNameChanging(global::System.String value);
        partial void OnSourceTypeNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String OwnerType
        {
            get
            {
                return _OwnerType;
            }
            set
            {
                OnOwnerTypeChanging(value);
                ReportPropertyChanging("OwnerType");
                _OwnerType = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("OwnerType");
                OnOwnerTypeChanged();
            }
        }
        private global::System.String _OwnerType;
        partial void OnOwnerTypeChanging(global::System.String value);
        partial void OnOwnerTypeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String State
        {
            get
            {
                return _State;
            }
            set
            {
                OnStateChanging(value);
                ReportPropertyChanging("State");
                _State = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("State");
                OnStateChanged();
            }
        }
        private global::System.String _State;
        partial void OnStateChanging(global::System.String value);
        partial void OnStateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String ChildActivityId
        {
            get
            {
                return _ChildActivityId;
            }
            set
            {
                OnChildActivityIdChanging(value);
                ReportPropertyChanging("ChildActivityId");
                _ChildActivityId = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("ChildActivityId");
                OnChildActivityIdChanged();
            }
        }
        private global::System.String _ChildActivityId;
        partial void OnChildActivityIdChanging(global::System.String value);
        partial void OnChildActivityIdChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String ChildInstanceId
        {
            get
            {
                return _ChildInstanceId;
            }
            set
            {
                OnChildInstanceIdChanging(value);
                ReportPropertyChanging("ChildInstanceId");
                _ChildInstanceId = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("ChildInstanceId");
                OnChildInstanceIdChanged();
            }
        }
        private global::System.String _ChildInstanceId;
        partial void OnChildInstanceIdChanging(global::System.String value);
        partial void OnChildInstanceIdChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String ChildTypeName
        {
            get
            {
                return _ChildTypeName;
            }
            set
            {
                OnChildTypeNameChanging(value);
                ReportPropertyChanging("ChildTypeName");
                _ChildTypeName = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("ChildTypeName");
                OnChildTypeNameChanged();
            }
        }
        private global::System.String _ChildTypeName;
        partial void OnChildTypeNameChanging(global::System.String value);
        partial void OnChildTypeNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String ChildActivityName
        {
            get
            {
                return _ChildActivityName;
            }
            set
            {
                OnChildActivityNameChanging(value);
                ReportPropertyChanging("ChildActivityName");
                _ChildActivityName = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("ChildActivityName");
                OnChildActivityNameChanged();
            }
        }
        private global::System.String _ChildActivityName;
        partial void OnChildActivityNameChanging(global::System.String value);
        partial void OnChildActivityNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String FaultSrcName
        {
            get
            {
                return _FaultSrcName;
            }
            set
            {
                OnFaultSrcNameChanging(value);
                ReportPropertyChanging("FaultSrcName");
                _FaultSrcName = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("FaultSrcName");
                OnFaultSrcNameChanged();
            }
        }
        private global::System.String _FaultSrcName;
        partial void OnFaultSrcNameChanging(global::System.String value);
        partial void OnFaultSrcNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String FaultSrcId
        {
            get
            {
                return _FaultSrcId;
            }
            set
            {
                OnFaultSrcIdChanging(value);
                ReportPropertyChanging("FaultSrcId");
                _FaultSrcId = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("FaultSrcId");
                OnFaultSrcIdChanged();
            }
        }
        private global::System.String _FaultSrcId;
        partial void OnFaultSrcIdChanging(global::System.String value);
        partial void OnFaultSrcIdChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String FaultSrcInstanceId
        {
            get
            {
                return _FaultSrcInstanceId;
            }
            set
            {
                OnFaultSrcInstanceIdChanging(value);
                ReportPropertyChanging("FaultSrcInstanceId");
                _FaultSrcInstanceId = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("FaultSrcInstanceId");
                OnFaultSrcInstanceIdChanged();
            }
        }
        private global::System.String _FaultSrcInstanceId;
        partial void OnFaultSrcInstanceIdChanging(global::System.String value);
        partial void OnFaultSrcInstanceIdChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String HandlerId
        {
            get
            {
                return _HandlerId;
            }
            set
            {
                OnHandlerIdChanging(value);
                ReportPropertyChanging("HandlerId");
                _HandlerId = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("HandlerId");
                OnHandlerIdChanged();
            }
        }
        private global::System.String _HandlerId;
        partial void OnHandlerIdChanging(global::System.String value);
        partial void OnHandlerIdChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String HandlerInstanceId
        {
            get
            {
                return _HandlerInstanceId;
            }
            set
            {
                OnHandlerInstanceIdChanging(value);
                ReportPropertyChanging("HandlerInstanceId");
                _HandlerInstanceId = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("HandlerInstanceId");
                OnHandlerInstanceIdChanged();
            }
        }
        private global::System.String _HandlerInstanceId;
        partial void OnHandlerInstanceIdChanging(global::System.String value);
        partial void OnHandlerInstanceIdChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String FaultHandler
        {
            get
            {
                return _FaultHandler;
            }
            set
            {
                OnFaultHandlerChanging(value);
                ReportPropertyChanging("FaultHandler");
                _FaultHandler = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("FaultHandler");
                OnFaultHandlerChanged();
            }
        }
        private global::System.String _FaultHandler;
        partial void OnFaultHandlerChanging(global::System.String value);
        partial void OnFaultHandlerChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String FaultSourceType
        {
            get
            {
                return _FaultSourceType;
            }
            set
            {
                OnFaultSourceTypeChanging(value);
                ReportPropertyChanging("FaultSourceType");
                _FaultSourceType = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("FaultSourceType");
                OnFaultSourceTypeChanged();
            }
        }
        private global::System.String _FaultSourceType;
        partial void OnFaultSourceTypeChanging(global::System.String value);
        partial void OnFaultSourceTypeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String FaultHandlerType
        {
            get
            {
                return _FaultHandlerType;
            }
            set
            {
                OnFaultHandlerTypeChanging(value);
                ReportPropertyChanging("FaultHandlerType");
                _FaultHandlerType = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("FaultHandlerType");
                OnFaultHandlerTypeChanged();
            }
        }
        private global::System.String _FaultHandlerType;
        partial void OnFaultHandlerTypeChanging(global::System.String value);
        partial void OnFaultHandlerTypeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String Fault
        {
            get
            {
                return _Fault;
            }
            set
            {
                OnFaultChanging(value);
                ReportPropertyChanging("Fault");
                _Fault = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("Fault");
                OnFaultChanged();
            }
        }
        private global::System.String _Fault;
        partial void OnFaultChanging(global::System.String value);
        partial void OnFaultChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> IsFaultSource
        {
            get
            {
                return _IsFaultSource;
            }
            set
            {
                OnIsFaultSourceChanging(value);
                ReportPropertyChanging("IsFaultSource");
                _IsFaultSource = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("IsFaultSource");
                OnIsFaultSourceChanged();
            }
        }
        private Nullable<global::System.Int32> _IsFaultSource;
        partial void OnIsFaultSourceChanging(Nullable<global::System.Int32> value);
        partial void OnIsFaultSourceChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String SubInstanceID
        {
            get
            {
                return _SubInstanceID;
            }
            set
            {
                OnSubInstanceIDChanging(value);
                ReportPropertyChanging("SubInstanceID");
                _SubInstanceID = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("SubInstanceID");
                OnSubInstanceIDChanged();
            }
        }
        private global::System.String _SubInstanceID;
        partial void OnSubInstanceIDChanging(global::System.String value);
        partial void OnSubInstanceIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String OwnerActivityId
        {
            get
            {
                return _OwnerActivityId;
            }
            set
            {
                OnOwnerActivityIdChanging(value);
                ReportPropertyChanging("OwnerActivityId");
                _OwnerActivityId = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("OwnerActivityId");
                OnOwnerActivityIdChanged();
            }
        }
        private global::System.String _OwnerActivityId;
        partial void OnOwnerActivityIdChanging(global::System.String value);
        partial void OnOwnerActivityIdChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String OwnerInstanceId
        {
            get
            {
                return _OwnerInstanceId;
            }
            set
            {
                OnOwnerInstanceIdChanging(value);
                ReportPropertyChanging("OwnerInstanceId");
                _OwnerInstanceId = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("OwnerInstanceId");
                OnOwnerInstanceIdChanged();
            }
        }
        private global::System.String _OwnerInstanceId;
        partial void OnOwnerInstanceIdChanging(global::System.String value);
        partial void OnOwnerInstanceIdChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String OwnerActivityName
        {
            get
            {
                return _OwnerActivityName;
            }
            set
            {
                OnOwnerActivityNameChanging(value);
                ReportPropertyChanging("OwnerActivityName");
                _OwnerActivityName = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("OwnerActivityName");
                OnOwnerActivityNameChanged();
            }
        }
        private global::System.String _OwnerActivityName;
        partial void OnOwnerActivityNameChanging(global::System.String value);
        partial void OnOwnerActivityNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String Exception
        {
            get
            {
                return _Exception;
            }
            set
            {
                OnExceptionChanging(value);
                ReportPropertyChanging("Exception");
                _Exception = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("Exception");
                OnExceptionChanged();
            }
        }
        private global::System.String _Exception;
        partial void OnExceptionChanging(global::System.String value);
        partial void OnExceptionChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String Reason
        {
            get
            {
                return _Reason;
            }
            set
            {
                OnReasonChanging(value);
                ReportPropertyChanging("Reason");
                _Reason = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("Reason");
                OnReasonChanged();
            }
        }
        private global::System.String _Reason;
        partial void OnReasonChanging(global::System.String value);
        partial void OnReasonChanged();

        #endregion
    
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AppFabricMonitoringDBModel", Name="ASWfInstance")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class ASWfInstance : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new ASWfInstance object.
        /// </summary>
        /// <param name="id">Initial value of the Id property.</param>
        /// <param name="workflowInstanceId">Initial value of the WorkflowInstanceId property.</param>
        /// <param name="lastEventSourceId">Initial value of the LastEventSourceId property.</param>
        /// <param name="lastEventStatus">Initial value of the LastEventStatus property.</param>
        /// <param name="startTime">Initial value of the StartTime property.</param>
        /// <param name="lastModifiedTime">Initial value of the LastModifiedTime property.</param>
        /// <param name="currentDuration">Initial value of the CurrentDuration property.</param>
        /// <param name="exceptionCount">Initial value of the ExceptionCount property.</param>
        public static ASWfInstance CreateASWfInstance(global::System.Int64 id, global::System.String workflowInstanceId, global::System.Int32 lastEventSourceId, global::System.String lastEventStatus, global::System.DateTime startTime, global::System.DateTime lastModifiedTime, global::System.Int32 currentDuration, global::System.Int32 exceptionCount)
        {
            ASWfInstance aSWfInstance = new ASWfInstance();
            aSWfInstance.Id = id;
            aSWfInstance.WorkflowInstanceId = workflowInstanceId;
            aSWfInstance.LastEventSourceId = lastEventSourceId;
            aSWfInstance.LastEventStatus = lastEventStatus;
            aSWfInstance.StartTime = startTime;
            aSWfInstance.LastModifiedTime = lastModifiedTime;
            aSWfInstance.CurrentDuration = currentDuration;
            aSWfInstance.ExceptionCount = exceptionCount;
            return aSWfInstance;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int64 Id
        {
            get
            {
                return _Id;
            }
            set
            {
                if (_Id != value)
                {
                    OnIdChanging(value);
                    ReportPropertyChanging("Id");
                    _Id = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("Id");
                    OnIdChanged();
                }
            }
        }
        private global::System.Int64 _Id;
        partial void OnIdChanging(global::System.Int64 value);
        partial void OnIdChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String WorkflowInstanceId
        {
            get
            {
                return _WorkflowInstanceId;
            }
            set
            {
                if (_WorkflowInstanceId != value)
                {
                    OnWorkflowInstanceIdChanging(value);
                    ReportPropertyChanging("WorkflowInstanceId");
                    _WorkflowInstanceId = StructuralObject.SetValidValue(value, false);
                    ReportPropertyChanged("WorkflowInstanceId");
                    OnWorkflowInstanceIdChanged();
                }
            }
        }
        private global::System.String _WorkflowInstanceId;
        partial void OnWorkflowInstanceIdChanging(global::System.String value);
        partial void OnWorkflowInstanceIdChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 LastEventSourceId
        {
            get
            {
                return _LastEventSourceId;
            }
            set
            {
                if (_LastEventSourceId != value)
                {
                    OnLastEventSourceIdChanging(value);
                    ReportPropertyChanging("LastEventSourceId");
                    _LastEventSourceId = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("LastEventSourceId");
                    OnLastEventSourceIdChanged();
                }
            }
        }
        private global::System.Int32 _LastEventSourceId;
        partial void OnLastEventSourceIdChanging(global::System.Int32 value);
        partial void OnLastEventSourceIdChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String LastEventStatus
        {
            get
            {
                return _LastEventStatus;
            }
            set
            {
                if (_LastEventStatus != value)
                {
                    OnLastEventStatusChanging(value);
                    ReportPropertyChanging("LastEventStatus");
                    _LastEventStatus = StructuralObject.SetValidValue(value, false);
                    ReportPropertyChanged("LastEventStatus");
                    OnLastEventStatusChanged();
                }
            }
        }
        private global::System.String _LastEventStatus;
        partial void OnLastEventStatusChanging(global::System.String value);
        partial void OnLastEventStatusChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime StartTime
        {
            get
            {
                return _StartTime;
            }
            set
            {
                if (_StartTime != value)
                {
                    OnStartTimeChanging(value);
                    ReportPropertyChanging("StartTime");
                    _StartTime = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("StartTime");
                    OnStartTimeChanged();
                }
            }
        }
        private global::System.DateTime _StartTime;
        partial void OnStartTimeChanging(global::System.DateTime value);
        partial void OnStartTimeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime LastModifiedTime
        {
            get
            {
                return _LastModifiedTime;
            }
            set
            {
                if (_LastModifiedTime != value)
                {
                    OnLastModifiedTimeChanging(value);
                    ReportPropertyChanging("LastModifiedTime");
                    _LastModifiedTime = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("LastModifiedTime");
                    OnLastModifiedTimeChanged();
                }
            }
        }
        private global::System.DateTime _LastModifiedTime;
        partial void OnLastModifiedTimeChanging(global::System.DateTime value);
        partial void OnLastModifiedTimeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 CurrentDuration
        {
            get
            {
                return _CurrentDuration;
            }
            set
            {
                if (_CurrentDuration != value)
                {
                    OnCurrentDurationChanging(value);
                    ReportPropertyChanging("CurrentDuration");
                    _CurrentDuration = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("CurrentDuration");
                    OnCurrentDurationChanged();
                }
            }
        }
        private global::System.Int32 _CurrentDuration;
        partial void OnCurrentDurationChanging(global::System.Int32 value);
        partial void OnCurrentDurationChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ExceptionCount
        {
            get
            {
                return _ExceptionCount;
            }
            set
            {
                if (_ExceptionCount != value)
                {
                    OnExceptionCountChanging(value);
                    ReportPropertyChanging("ExceptionCount");
                    _ExceptionCount = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ExceptionCount");
                    OnExceptionCountChanged();
                }
            }
        }
        private global::System.Int32 _ExceptionCount;
        partial void OnExceptionCountChanging(global::System.Int32 value);
        partial void OnExceptionCountChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.DateTime> LastAbortedTime
        {
            get
            {
                return _LastAbortedTime;
            }
            set
            {
                OnLastAbortedTimeChanging(value);
                ReportPropertyChanging("LastAbortedTime");
                _LastAbortedTime = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("LastAbortedTime");
                OnLastAbortedTimeChanged();
            }
        }
        private Nullable<global::System.DateTime> _LastAbortedTime;
        partial void OnLastAbortedTimeChanging(Nullable<global::System.DateTime> value);
        partial void OnLastAbortedTimeChanged();

        #endregion
    
    }

    #endregion
    
}