Click here to Skip to main content
15,895,777 members
Articles / Web Development / ASP.NET

Navigational Workflows Unleashed in WWF/ASP.NET 3.5

Rate me:
Please Sign up or sign in to vote.
4.97/5 (42 votes)
21 Oct 2008CPOL18 min read 226K   1.6K   165  
Case-study on the internals of a Navigational Workflow engine for a fictional dating website called “World Wide Dating”.
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.1434
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace DateSite
{
	using System.Data.Linq;
	using System.Data.Linq.Mapping;
	using System.Data;
	using System.Collections.Generic;
	using System.Reflection;
	using System.Linq;
	using System.Linq.Expressions;
	using System.ComponentModel;
	using System;
	
	
	[System.Data.Linq.Mapping.DatabaseAttribute(Name="Dating")]
	public partial class ProfileDataContext : System.Data.Linq.DataContext
	{
		
		private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
		
    #region Extensibility Method Definitions
    partial void OnCreated();
    partial void InsertInstanceState(InstanceState instance);
    partial void UpdateInstanceState(InstanceState instance);
    partial void DeleteInstanceState(InstanceState instance);
    partial void InsertProfile(Profile instance);
    partial void UpdateProfile(Profile instance);
    partial void DeleteProfile(Profile instance);
    #endregion
		
		public ProfileDataContext() : 
				base(global::System.Configuration.ConfigurationManager.ConnectionStrings["DatingConnectionString"].ConnectionString, mappingSource)
		{
			OnCreated();
		}
		
		public ProfileDataContext(string connection) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public ProfileDataContext(System.Data.IDbConnection connection) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public ProfileDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public ProfileDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public System.Data.Linq.Table<InstanceState> InstanceStates
		{
			get
			{
				return this.GetTable<InstanceState>();
			}
		}
		
		public System.Data.Linq.Table<Profile> Profiles
		{
			get
			{
				return this.GetTable<Profile>();
			}
		}
	}
	
	[Table(Name="dbo.InstanceState")]
	public partial class InstanceState : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private System.Guid _uidInstanceID;
		
		private System.Data.Linq.Binary _state;
		
		private System.Nullable<int> _status;
		
		private System.Nullable<int> _unlocked;
		
		private System.Nullable<int> _blocked;
		
		private string _info;
		
		private System.DateTime _modified;
		
		private System.Nullable<System.Guid> _ownerID;
		
		private System.Nullable<System.DateTime> _ownedUntil;
		
		private System.Nullable<System.DateTime> _nextTimer;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnuidInstanceIDChanging(System.Guid value);
    partial void OnuidInstanceIDChanged();
    partial void OnstateChanging(System.Data.Linq.Binary value);
    partial void OnstateChanged();
    partial void OnstatusChanging(System.Nullable<int> value);
    partial void OnstatusChanged();
    partial void OnunlockedChanging(System.Nullable<int> value);
    partial void OnunlockedChanged();
    partial void OnblockedChanging(System.Nullable<int> value);
    partial void OnblockedChanged();
    partial void OninfoChanging(string value);
    partial void OninfoChanged();
    partial void OnmodifiedChanging(System.DateTime value);
    partial void OnmodifiedChanged();
    partial void OnownerIDChanging(System.Nullable<System.Guid> value);
    partial void OnownerIDChanged();
    partial void OnownedUntilChanging(System.Nullable<System.DateTime> value);
    partial void OnownedUntilChanged();
    partial void OnnextTimerChanging(System.Nullable<System.DateTime> value);
    partial void OnnextTimerChanged();
    #endregion
		
		public InstanceState()
		{
			OnCreated();
		}
		
		[Column(Storage="_uidInstanceID", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
		public System.Guid uidInstanceID
		{
			get
			{
				return this._uidInstanceID;
			}
			set
			{
				if ((this._uidInstanceID != value))
				{
					this.OnuidInstanceIDChanging(value);
					this.SendPropertyChanging();
					this._uidInstanceID = value;
					this.SendPropertyChanged("uidInstanceID");
					this.OnuidInstanceIDChanged();
				}
			}
		}
		
		[Column(Storage="_state", DbType="Image", UpdateCheck=UpdateCheck.Never)]
		public System.Data.Linq.Binary state
		{
			get
			{
				return this._state;
			}
			set
			{
				if ((this._state != value))
				{
					this.OnstateChanging(value);
					this.SendPropertyChanging();
					this._state = value;
					this.SendPropertyChanged("state");
					this.OnstateChanged();
				}
			}
		}
		
		[Column(Storage="_status", DbType="Int")]
		public System.Nullable<int> status
		{
			get
			{
				return this._status;
			}
			set
			{
				if ((this._status != value))
				{
					this.OnstatusChanging(value);
					this.SendPropertyChanging();
					this._status = value;
					this.SendPropertyChanged("status");
					this.OnstatusChanged();
				}
			}
		}
		
		[Column(Storage="_unlocked", DbType="Int")]
		public System.Nullable<int> unlocked
		{
			get
			{
				return this._unlocked;
			}
			set
			{
				if ((this._unlocked != value))
				{
					this.OnunlockedChanging(value);
					this.SendPropertyChanging();
					this._unlocked = value;
					this.SendPropertyChanged("unlocked");
					this.OnunlockedChanged();
				}
			}
		}
		
		[Column(Storage="_blocked", DbType="Int")]
		public System.Nullable<int> blocked
		{
			get
			{
				return this._blocked;
			}
			set
			{
				if ((this._blocked != value))
				{
					this.OnblockedChanging(value);
					this.SendPropertyChanging();
					this._blocked = value;
					this.SendPropertyChanged("blocked");
					this.OnblockedChanged();
				}
			}
		}
		
		[Column(Storage="_info", DbType="NText", UpdateCheck=UpdateCheck.Never)]
		public string info
		{
			get
			{
				return this._info;
			}
			set
			{
				if ((this._info != value))
				{
					this.OninfoChanging(value);
					this.SendPropertyChanging();
					this._info = value;
					this.SendPropertyChanged("info");
					this.OninfoChanged();
				}
			}
		}
		
		[Column(Storage="_modified", DbType="DateTime NOT NULL")]
		public System.DateTime modified
		{
			get
			{
				return this._modified;
			}
			set
			{
				if ((this._modified != value))
				{
					this.OnmodifiedChanging(value);
					this.SendPropertyChanging();
					this._modified = value;
					this.SendPropertyChanged("modified");
					this.OnmodifiedChanged();
				}
			}
		}
		
		[Column(Storage="_ownerID", DbType="UniqueIdentifier")]
		public System.Nullable<System.Guid> ownerID
		{
			get
			{
				return this._ownerID;
			}
			set
			{
				if ((this._ownerID != value))
				{
					this.OnownerIDChanging(value);
					this.SendPropertyChanging();
					this._ownerID = value;
					this.SendPropertyChanged("ownerID");
					this.OnownerIDChanged();
				}
			}
		}
		
		[Column(Storage="_ownedUntil", DbType="DateTime")]
		public System.Nullable<System.DateTime> ownedUntil
		{
			get
			{
				return this._ownedUntil;
			}
			set
			{
				if ((this._ownedUntil != value))
				{
					this.OnownedUntilChanging(value);
					this.SendPropertyChanging();
					this._ownedUntil = value;
					this.SendPropertyChanged("ownedUntil");
					this.OnownedUntilChanged();
				}
			}
		}
		
		[Column(Storage="_nextTimer", DbType="DateTime")]
		public System.Nullable<System.DateTime> nextTimer
		{
			get
			{
				return this._nextTimer;
			}
			set
			{
				if ((this._nextTimer != value))
				{
					this.OnnextTimerChanging(value);
					this.SendPropertyChanging();
					this._nextTimer = value;
					this.SendPropertyChanged("nextTimer");
					this.OnnextTimerChanged();
				}
			}
		}
		
		public event PropertyChangingEventHandler PropertyChanging;
		
		public event PropertyChangedEventHandler PropertyChanged;
		
		protected virtual void SendPropertyChanging()
		{
			if ((this.PropertyChanging != null))
			{
				this.PropertyChanging(this, emptyChangingEventArgs);
			}
		}
		
		protected virtual void SendPropertyChanged(String propertyName)
		{
			if ((this.PropertyChanged != null))
			{
				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
			}
		}
	}
	
	[Table(Name="dbo.Profile")]
	public partial class Profile : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private string _DatingId;
		
		private System.Guid _WorkflowId;
		
		private string _EyeColor;
		
		private string _HairColor;
		
		private string _BestFeature;
		
		private string _LookingFor;
		
		private string _StartAge;
		
		private string _EndAge;
		
		private string _Feet;
		
		private string _Inches;
		
		private string _FunActivities;
		
		private string _FavoriteDestinations;
		
		private string _LastRead;
		
		private string _ExerciseHabits;
		
		private string _Smoking;
		
		private string _Drinking;
		
		private System.Data.Linq.Binary _TimeStamp;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnDatingIdChanging(string value);
    partial void OnDatingIdChanged();
    partial void OnWorkflowIdChanging(System.Guid value);
    partial void OnWorkflowIdChanged();
    partial void OnEyeColorChanging(string value);
    partial void OnEyeColorChanged();
    partial void OnHairColorChanging(string value);
    partial void OnHairColorChanged();
    partial void OnBestFeatureChanging(string value);
    partial void OnBestFeatureChanged();
    partial void OnLookingForChanging(string value);
    partial void OnLookingForChanged();
    partial void OnStartAgeChanging(string value);
    partial void OnStartAgeChanged();
    partial void OnEndAgeChanging(string value);
    partial void OnEndAgeChanged();
    partial void OnFeetChanging(string value);
    partial void OnFeetChanged();
    partial void OnInchesChanging(string value);
    partial void OnInchesChanged();
    partial void OnFunActivitiesChanging(string value);
    partial void OnFunActivitiesChanged();
    partial void OnFavoriteDestinationsChanging(string value);
    partial void OnFavoriteDestinationsChanged();
    partial void OnLastReadChanging(string value);
    partial void OnLastReadChanged();
    partial void OnExerciseHabitsChanging(string value);
    partial void OnExerciseHabitsChanged();
    partial void OnSmokingChanging(string value);
    partial void OnSmokingChanged();
    partial void OnDrinkingChanging(string value);
    partial void OnDrinkingChanged();
    partial void OnTimeStampChanging(System.Data.Linq.Binary value);
    partial void OnTimeStampChanged();
    #endregion
		
		public Profile()
		{
			OnCreated();
		}
		
		[Column(Storage="_DatingId", DbType="VarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true, UpdateCheck=UpdateCheck.Never)]
		public string DatingId
		{
			get
			{
				return this._DatingId;
			}
			set
			{
				if ((this._DatingId != value))
				{
					this.OnDatingIdChanging(value);
					this.SendPropertyChanging();
					this._DatingId = value;
					this.SendPropertyChanged("DatingId");
					this.OnDatingIdChanged();
				}
			}
		}
		
		[Column(Storage="_WorkflowId", DbType="UniqueIdentifier NOT NULL", UpdateCheck=UpdateCheck.Never)]
		public System.Guid WorkflowId
		{
			get
			{
				return this._WorkflowId;
			}
			set
			{
				if ((this._WorkflowId != value))
				{
					this.OnWorkflowIdChanging(value);
					this.SendPropertyChanging();
					this._WorkflowId = value;
					this.SendPropertyChanged("WorkflowId");
					this.OnWorkflowIdChanged();
				}
			}
		}
		
		[Column(Storage="_EyeColor", DbType="VarChar(50)", UpdateCheck=UpdateCheck.Never)]
		public string EyeColor
		{
			get
			{
				return this._EyeColor;
			}
			set
			{
				if ((this._EyeColor != value))
				{
					this.OnEyeColorChanging(value);
					this.SendPropertyChanging();
					this._EyeColor = value;
					this.SendPropertyChanged("EyeColor");
					this.OnEyeColorChanged();
				}
			}
		}
		
		[Column(Storage="_HairColor", DbType="VarChar(50)", UpdateCheck=UpdateCheck.Never)]
		public string HairColor
		{
			get
			{
				return this._HairColor;
			}
			set
			{
				if ((this._HairColor != value))
				{
					this.OnHairColorChanging(value);
					this.SendPropertyChanging();
					this._HairColor = value;
					this.SendPropertyChanged("HairColor");
					this.OnHairColorChanged();
				}
			}
		}
		
		[Column(Storage="_BestFeature", DbType="VarChar(50)", UpdateCheck=UpdateCheck.Never)]
		public string BestFeature
		{
			get
			{
				return this._BestFeature;
			}
			set
			{
				if ((this._BestFeature != value))
				{
					this.OnBestFeatureChanging(value);
					this.SendPropertyChanging();
					this._BestFeature = value;
					this.SendPropertyChanged("BestFeature");
					this.OnBestFeatureChanged();
				}
			}
		}
		
		[Column(Storage="_LookingFor", DbType="VarChar(50)", UpdateCheck=UpdateCheck.Never)]
		public string LookingFor
		{
			get
			{
				return this._LookingFor;
			}
			set
			{
				if ((this._LookingFor != value))
				{
					this.OnLookingForChanging(value);
					this.SendPropertyChanging();
					this._LookingFor = value;
					this.SendPropertyChanged("LookingFor");
					this.OnLookingForChanged();
				}
			}
		}
		
		[Column(Storage="_StartAge", DbType="VarChar(50)", UpdateCheck=UpdateCheck.Never)]
		public string StartAge
		{
			get
			{
				return this._StartAge;
			}
			set
			{
				if ((this._StartAge != value))
				{
					this.OnStartAgeChanging(value);
					this.SendPropertyChanging();
					this._StartAge = value;
					this.SendPropertyChanged("StartAge");
					this.OnStartAgeChanged();
				}
			}
		}
		
		[Column(Storage="_EndAge", DbType="VarChar(50)", UpdateCheck=UpdateCheck.Never)]
		public string EndAge
		{
			get
			{
				return this._EndAge;
			}
			set
			{
				if ((this._EndAge != value))
				{
					this.OnEndAgeChanging(value);
					this.SendPropertyChanging();
					this._EndAge = value;
					this.SendPropertyChanged("EndAge");
					this.OnEndAgeChanged();
				}
			}
		}
		
		[Column(Storage="_Feet", DbType="VarChar(50)", UpdateCheck=UpdateCheck.Never)]
		public string Feet
		{
			get
			{
				return this._Feet;
			}
			set
			{
				if ((this._Feet != value))
				{
					this.OnFeetChanging(value);
					this.SendPropertyChanging();
					this._Feet = value;
					this.SendPropertyChanged("Feet");
					this.OnFeetChanged();
				}
			}
		}
		
		[Column(Storage="_Inches", DbType="VarChar(50)", UpdateCheck=UpdateCheck.Never)]
		public string Inches
		{
			get
			{
				return this._Inches;
			}
			set
			{
				if ((this._Inches != value))
				{
					this.OnInchesChanging(value);
					this.SendPropertyChanging();
					this._Inches = value;
					this.SendPropertyChanged("Inches");
					this.OnInchesChanged();
				}
			}
		}
		
		[Column(Storage="_FunActivities", DbType="VarChar(MAX)", UpdateCheck=UpdateCheck.Never)]
		public string FunActivities
		{
			get
			{
				return this._FunActivities;
			}
			set
			{
				if ((this._FunActivities != value))
				{
					this.OnFunActivitiesChanging(value);
					this.SendPropertyChanging();
					this._FunActivities = value;
					this.SendPropertyChanged("FunActivities");
					this.OnFunActivitiesChanged();
				}
			}
		}
		
		[Column(Storage="_FavoriteDestinations", DbType="VarChar(MAX)", UpdateCheck=UpdateCheck.Never)]
		public string FavoriteDestinations
		{
			get
			{
				return this._FavoriteDestinations;
			}
			set
			{
				if ((this._FavoriteDestinations != value))
				{
					this.OnFavoriteDestinationsChanging(value);
					this.SendPropertyChanging();
					this._FavoriteDestinations = value;
					this.SendPropertyChanged("FavoriteDestinations");
					this.OnFavoriteDestinationsChanged();
				}
			}
		}
		
		[Column(Storage="_LastRead", DbType="VarChar(MAX)", UpdateCheck=UpdateCheck.Never)]
		public string LastRead
		{
			get
			{
				return this._LastRead;
			}
			set
			{
				if ((this._LastRead != value))
				{
					this.OnLastReadChanging(value);
					this.SendPropertyChanging();
					this._LastRead = value;
					this.SendPropertyChanged("LastRead");
					this.OnLastReadChanged();
				}
			}
		}
		
		[Column(Storage="_ExerciseHabits", DbType="VarChar(50)", UpdateCheck=UpdateCheck.Never)]
		public string ExerciseHabits
		{
			get
			{
				return this._ExerciseHabits;
			}
			set
			{
				if ((this._ExerciseHabits != value))
				{
					this.OnExerciseHabitsChanging(value);
					this.SendPropertyChanging();
					this._ExerciseHabits = value;
					this.SendPropertyChanged("ExerciseHabits");
					this.OnExerciseHabitsChanged();
				}
			}
		}
		
		[Column(Storage="_Smoking", DbType="VarChar(50)", UpdateCheck=UpdateCheck.Never)]
		public string Smoking
		{
			get
			{
				return this._Smoking;
			}
			set
			{
				if ((this._Smoking != value))
				{
					this.OnSmokingChanging(value);
					this.SendPropertyChanging();
					this._Smoking = value;
					this.SendPropertyChanged("Smoking");
					this.OnSmokingChanged();
				}
			}
		}
		
		[Column(Storage="_Drinking", DbType="VarChar(50)", UpdateCheck=UpdateCheck.Never)]
		public string Drinking
		{
			get
			{
				return this._Drinking;
			}
			set
			{
				if ((this._Drinking != value))
				{
					this.OnDrinkingChanging(value);
					this.SendPropertyChanging();
					this._Drinking = value;
					this.SendPropertyChanged("Drinking");
					this.OnDrinkingChanged();
				}
			}
		}
		
		[Column(Storage="_TimeStamp", AutoSync=AutoSync.Always, DbType="rowversion NOT NULL", CanBeNull=false, IsDbGenerated=true, IsVersion=true, UpdateCheck=UpdateCheck.Never)]
		public System.Data.Linq.Binary TimeStamp
		{
			get
			{
				return this._TimeStamp;
			}
			set
			{
				if ((this._TimeStamp != value))
				{
					this.OnTimeStampChanging(value);
					this.SendPropertyChanging();
					this._TimeStamp = value;
					this.SendPropertyChanged("TimeStamp");
					this.OnTimeStampChanged();
				}
			}
		}
		
		public event PropertyChangingEventHandler PropertyChanging;
		
		public event PropertyChangedEventHandler PropertyChanged;
		
		protected virtual void SendPropertyChanging()
		{
			if ((this.PropertyChanging != null))
			{
				this.PropertyChanging(this, emptyChangingEventArgs);
			}
		}
		
		protected virtual void SendPropertyChanged(String propertyName)
		{
			if ((this.PropertyChanged != null))
			{
				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
			}
		}
	}
}
#pragma warning restore 1591

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
Founder Turing Inc.
United States United States

Comments and Discussions