#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.42000
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace hadb6
{
	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;
	using OBMWS;

	
	
	[global::System.Data.Linq.Mapping.DatabaseAttribute(Name="hadb6")]
	public partial class hadb6DataContext : WSDataContext
	{
		
		private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
		
    #region Extensibility Method Definitions
    partial void OnCreated();
    partial void InsertUserHierarki(UserHierarki instance);
    partial void UpdateUserHierarki(UserHierarki instance);
    partial void DeleteUserHierarki(UserHierarki instance);
    partial void InsertContentType(ContentType instance);
    partial void UpdateContentType(ContentType instance);
    partial void DeleteContentType(ContentType instance);
    partial void InsertError(Error instance);
    partial void UpdateError(Error instance);
    partial void DeleteError(Error instance);
    partial void InsertGeo_Image(Geo_Image instance);
    partial void UpdateGeo_Image(Geo_Image instance);
    partial void DeleteGeo_Image(Geo_Image instance);
    partial void InsertImage(Image instance);
    partial void UpdateImage(Image instance);
    partial void DeleteImage(Image instance);
    partial void InsertLicen(Licen instance);
    partial void UpdateLicen(Licen instance);
    partial void DeleteLicen(Licen instance);
    partial void InsertLog(Log instance);
    partial void UpdateLog(Log instance);
    partial void DeleteLog(Log instance);
    partial void InsertLogSource(LogSource instance);
    partial void UpdateLogSource(LogSource instance);
    partial void DeleteLogSource(LogSource instance);
    partial void InsertLogType(LogType instance);
    partial void UpdateLogType(LogType instance);
    partial void DeleteLogType(LogType instance);
    partial void InsertRegion(Region instance);
    partial void UpdateRegion(Region instance);
    partial void DeleteRegion(Region instance);
    partial void InsertRegion_Region(Region_Region instance);
    partial void UpdateRegion_Region(Region_Region instance);
    partial void DeleteRegion_Region(Region_Region instance);
    partial void InsertRegion_RegionSource(Region_RegionSource instance);
    partial void UpdateRegion_RegionSource(Region_RegionSource instance);
    partial void DeleteRegion_RegionSource(Region_RegionSource instance);
    partial void InsertRegionSource(RegionSource instance);
    partial void UpdateRegionSource(RegionSource instance);
    partial void DeleteRegionSource(RegionSource instance);
    partial void InsertRegionType(RegionType instance);
    partial void UpdateRegionType(RegionType instance);
    partial void DeleteRegionType(RegionType instance);
    partial void InsertRegionTypeCategory(RegionTypeCategory instance);
    partial void UpdateRegionTypeCategory(RegionTypeCategory instance);
    partial void DeleteRegionTypeCategory(RegionTypeCategory instance);
    partial void InsertRole(Role instance);
    partial void UpdateRole(Role instance);
    partial void DeleteRole(Role instance);
    partial void InsertSession(Session instance);
    partial void UpdateSession(Session instance);
    partial void DeleteSession(Session instance);
    partial void InsertSocialProfile(SocialProfile instance);
    partial void UpdateSocialProfile(SocialProfile instance);
    partial void DeleteSocialProfile(SocialProfile instance);
    partial void InsertTag_Content(Tag_Content instance);
    partial void UpdateTag_Content(Tag_Content instance);
    partial void DeleteTag_Content(Tag_Content instance);
    partial void InsertTag_Geo(Tag_Geo instance);
    partial void UpdateTag_Geo(Tag_Geo instance);
    partial void DeleteTag_Geo(Tag_Geo instance);
    partial void InsertTag_Image(Tag_Image instance);
    partial void UpdateTag_Image(Tag_Image instance);
    partial void DeleteTag_Image(Tag_Image instance);
    partial void InsertTagHierarki(TagHierarki instance);
    partial void UpdateTagHierarki(TagHierarki instance);
    partial void DeleteTagHierarki(TagHierarki instance);
    partial void InsertUser(User instance);
    partial void UpdateUser(User instance);
    partial void DeleteUser(User instance);
    partial void InsertTheme(Theme instance);
    partial void UpdateTheme(Theme instance);
    partial void DeleteTheme(Theme instance);
    partial void InsertTag(Tag instance);
    partial void UpdateTag(Tag instance);
    partial void DeleteTag(Tag instance);
    partial void InsertGeo(Geo instance);
    partial void UpdateGeo(Geo instance);
    partial void DeleteGeo(Geo instance);
    partial void InsertCollection(Collection instance);
    partial void UpdateCollection(Collection instance);
    partial void DeleteCollection(Collection instance);
    partial void InsertCollection_Geo(Collection_Geo instance);
    partial void UpdateCollection_Geo(Collection_Geo instance);
    partial void DeleteCollection_Geo(Collection_Geo instance);
    partial void InsertMap(Map instance);
    partial void UpdateMap(Map instance);
    partial void DeleteMap(Map instance);
    partial void InsertPDF(PDF instance);
    partial void UpdatePDF(PDF instance);
    partial void DeletePDF(PDF instance);
    partial void InsertContent(Content instance);
    partial void UpdateContent(Content instance);
    partial void DeleteContent(Content instance);
    partial void InsertBiblio(Biblio instance);
    partial void UpdateBiblio(Biblio instance);
    partial void DeleteBiblio(Biblio instance);
    partial void InsertInstitution(Institution instance);
    partial void UpdateInstitution(Institution instance);
    partial void DeleteInstitution(Institution instance);
    partial void InsertExternalContent(ExternalContent instance);
    partial void UpdateExternalContent(ExternalContent instance);
    partial void DeleteExternalContent(ExternalContent instance);
    partial void InsertUser_Institution(User_Institution instance);
    partial void UpdateUser_Institution(User_Institution instance);
    partial void DeleteUser_Institution(User_Institution instance);
    partial void InsertText(Text instance);
    partial void UpdateText(Text instance);
    partial void DeleteText(Text instance);
    #endregion
		
		public hadb6DataContext() : 
				base(global::DB.Properties.Settings.Default.hadb6ConnectionString, mappingSource)
		{
			OnCreated();
		}
		
		public hadb6DataContext(string connection) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public hadb6DataContext(System.Data.IDbConnection connection) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public hadb6DataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public hadb6DataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public System.Data.Linq.Table<UserHierarki> UserHierarkis
		{
			get
			{
				return this.GetTable<UserHierarki>();
			}
		}
		
		public System.Data.Linq.Table<ContentType> ContentTypes
		{
			get
			{
				return this.GetTable<ContentType>();
			}
		}
		
		public System.Data.Linq.Table<Error> Errors
		{
			get
			{
				return this.GetTable<Error>();
			}
		}
		
		public System.Data.Linq.Table<Geo_Image> Geo_Images
		{
			get
			{
				return this.GetTable<Geo_Image>();
			}
		}
		
		public System.Data.Linq.Table<Image> Images
		{
			get
			{
				return this.GetTable<Image>();
			}
		}
		
		public System.Data.Linq.Table<Licen> Licens
		{
			get
			{
				return this.GetTable<Licen>();
			}
		}
		
		public System.Data.Linq.Table<Log> Logs
		{
			get
			{
				return this.GetTable<Log>();
			}
		}
		
		public System.Data.Linq.Table<LogSource> LogSources
		{
			get
			{
				return this.GetTable<LogSource>();
			}
		}
		
		public System.Data.Linq.Table<LogType> LogTypes
		{
			get
			{
				return this.GetTable<LogType>();
			}
		}
		
		public System.Data.Linq.Table<Region> Regions
		{
			get
			{
				return this.GetTable<Region>();
			}
		}
		
		public System.Data.Linq.Table<Region_Region> Region_Regions
		{
			get
			{
				return this.GetTable<Region_Region>();
			}
		}
		
		public System.Data.Linq.Table<Region_RegionSource> Region_RegionSources
		{
			get
			{
				return this.GetTable<Region_RegionSource>();
			}
		}
		
		public System.Data.Linq.Table<RegionSource> RegionSources
		{
			get
			{
				return this.GetTable<RegionSource>();
			}
		}
		
		public System.Data.Linq.Table<RegionType> RegionTypes
		{
			get
			{
				return this.GetTable<RegionType>();
			}
		}
		
		public System.Data.Linq.Table<RegionTypeCategory> RegionTypeCategories
		{
			get
			{
				return this.GetTable<RegionTypeCategory>();
			}
		}
		
		public System.Data.Linq.Table<Role> Roles
		{
			get
			{
				return this.GetTable<Role>();
			}
		}
		
		public System.Data.Linq.Table<Session> Sessions
		{
			get
			{
				return this.GetTable<Session>();
			}
		}
		
		public System.Data.Linq.Table<SocialProfile> SocialProfiles
		{
			get
			{
				return this.GetTable<SocialProfile>();
			}
		}
		
		public System.Data.Linq.Table<Tag_Content> Tag_Contents
		{
			get
			{
				return this.GetTable<Tag_Content>();
			}
		}
		
		public System.Data.Linq.Table<Tag_Geo> Tag_Geos
		{
			get
			{
				return this.GetTable<Tag_Geo>();
			}
		}
		
		public System.Data.Linq.Table<Tag_Image> Tag_Images
		{
			get
			{
				return this.GetTable<Tag_Image>();
			}
		}
		
		public System.Data.Linq.Table<TagHierarki> TagHierarkis
		{
			get
			{
				return this.GetTable<TagHierarki>();
			}
		}
		
		public System.Data.Linq.Table<User> Users
		{
			get
			{
				return this.GetTable<User>();
			}
		}
		
		public System.Data.Linq.Table<Theme> Themes
		{
			get
			{
				return this.GetTable<Theme>();
			}
		}
		
		public System.Data.Linq.Table<Tag> Tags
		{
			get
			{
				return this.GetTable<Tag>();
			}
		}
		
		public System.Data.Linq.Table<Geo> Geos
		{
			get
			{
				return this.GetTable<Geo>();
			}
		}
		
		public System.Data.Linq.Table<Collection> Collections
		{
			get
			{
				return this.GetTable<Collection>();
			}
		}
		
		public System.Data.Linq.Table<Collection_Geo> Collection_Geos
		{
			get
			{
				return this.GetTable<Collection_Geo>();
			}
		}
		
		public System.Data.Linq.Table<Map> Maps
		{
			get
			{
				return this.GetTable<Map>();
			}
		}
		
		public System.Data.Linq.Table<PDF> PDFs
		{
			get
			{
				return this.GetTable<PDF>();
			}
		}
		
		public System.Data.Linq.Table<Content> Contents
		{
			get
			{
				return this.GetTable<Content>();
			}
		}
		
		public System.Data.Linq.Table<Biblio> Biblios
		{
			get
			{
				return this.GetTable<Biblio>();
			}
		}
		
		public System.Data.Linq.Table<Institution> Institutions
		{
			get
			{
				return this.GetTable<Institution>();
			}
		}
		
		public System.Data.Linq.Table<ExternalContent> ExternalContents
		{
			get
			{
				return this.GetTable<ExternalContent>();
			}
		}
		
		public System.Data.Linq.Table<User_Institution> User_Institutions
		{
			get
			{
				return this.GetTable<User_Institution>();
			}
		}
		
		public System.Data.Linq.Table<Text> Texts
		{
			get
			{
				return this.GetTable<Text>();
			}
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.UserHierarki")]
	public partial class UserHierarki : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _UpperUserID;
		
		private int _UserID;
		
		private EntityRef<User> _User;
		
		private EntityRef<User> _User1;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnUpperUserIDChanging(int value);
    partial void OnUpperUserIDChanged();
    partial void OnUserIDChanging(int value);
    partial void OnUserIDChanged();
    #endregion
		
		public UserHierarki()
		{
			this._User = default(EntityRef<User>);
			this._User1 = default(EntityRef<User>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UpperUserID", DbType="Int NOT NULL", IsPrimaryKey=true)]
		public int UpperUserID
		{
			get
			{
				return this._UpperUserID;
			}
			set
			{
				if ((this._UpperUserID != value))
				{
					if (this._User.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnUpperUserIDChanging(value);
					this.SendPropertyChanging();
					this._UpperUserID = value;
					this.SendPropertyChanged("UpperUserID");
					this.OnUpperUserIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserID", DbType="Int NOT NULL", IsPrimaryKey=true)]
		public int UserID
		{
			get
			{
				return this._UserID;
			}
			set
			{
				if ((this._UserID != value))
				{
					if (this._User1.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnUserIDChanging(value);
					this.SendPropertyChanging();
					this._UserID = value;
					this.SendPropertyChanged("UserID");
					this.OnUserIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_UserHierarki", Storage="_User", ThisKey="UpperUserID", OtherKey="UserID", IsForeignKey=true)]
		public User User
		{
			get
			{
				return this._User.Entity;
			}
			set
			{
				User previousValue = this._User.Entity;
				if (((previousValue != value) 
							|| (this._User.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._User.Entity = null;
						previousValue.UserHierarkis.Remove(this);
					}
					this._User.Entity = value;
					if ((value != null))
					{
						value.UserHierarkis.Add(this);
						this._UpperUserID = value.UserID;
					}
					else
					{
						this._UpperUserID = default(int);
					}
					this.SendPropertyChanged("User");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_UserHierarki1", Storage="_User1", ThisKey="UserID", OtherKey="UserID", IsForeignKey=true)]
		public User User1
		{
			get
			{
				return this._User1.Entity;
			}
			set
			{
				User previousValue = this._User1.Entity;
				if (((previousValue != value) 
							|| (this._User1.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._User1.Entity = null;
						previousValue.UserHierarkis1.Remove(this);
					}
					this._User1.Entity = value;
					if ((value != null))
					{
						value.UserHierarkis1.Add(this);
						this._UserID = value.UserID;
					}
					else
					{
						this._UserID = default(int);
					}
					this.SendPropertyChanged("User1");
				}
			}
		}
		
		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));
			}
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.ContentType")]
	public partial class ContentType : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private byte _ContentTypeID;
		
		private string _Name;
		
		private EntitySet<Content> _Contents;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnContentTypeIDChanging(byte value);
    partial void OnContentTypeIDChanged();
    partial void OnNameChanging(string value);
    partial void OnNameChanged();
    #endregion
		
		public ContentType()
		{
			this._Contents = new EntitySet<Content>(new Action<Content>(this.attach_Contents), new Action<Content>(this.detach_Contents));
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContentTypeID", DbType="TinyInt NOT NULL", IsPrimaryKey=true)]
		public byte ContentTypeID
		{
			get
			{
				return this._ContentTypeID;
			}
			set
			{
				if ((this._ContentTypeID != value))
				{
					this.OnContentTypeIDChanging(value);
					this.SendPropertyChanging();
					this._ContentTypeID = value;
					this.SendPropertyChanged("ContentTypeID");
					this.OnContentTypeIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
		public string Name
		{
			get
			{
				return this._Name;
			}
			set
			{
				if ((this._Name != value))
				{
					this.OnNameChanging(value);
					this.SendPropertyChanging();
					this._Name = value;
					this.SendPropertyChanged("Name");
					this.OnNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="ContentType_Content", Storage="_Contents", ThisKey="ContentTypeID", OtherKey="ContentTypeID")]
		public EntitySet<Content> Contents
		{
			get
			{
				return this._Contents;
			}
			set
			{
				this._Contents.Assign(value);
			}
		}
		
		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));
			}
		}
		
		private void attach_Contents(Content entity)
		{
			this.SendPropertyChanging();
			entity.ContentType = this;
		}
		
		private void detach_Contents(Content entity)
		{
			this.SendPropertyChanging();
			entity.ContentType = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Error")]
	public partial class Error : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _ID;
		
		private string _Source;
		
		private string _Message;
		
		private string _Description;
		
		private System.DateTime _DateCreated;
		
		private string _IP;
		
		private System.Nullable<System.Guid> _EKey;
		
		private string _Notes;
		
		private System.Nullable<int> _UserID;
		
		private EntityRef<User> _User;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnIDChanging(int value);
    partial void OnIDChanged();
    partial void OnSourceChanging(string value);
    partial void OnSourceChanged();
    partial void OnMessageChanging(string value);
    partial void OnMessageChanged();
    partial void OnDescriptionChanging(string value);
    partial void OnDescriptionChanged();
    partial void OnDateCreatedChanging(System.DateTime value);
    partial void OnDateCreatedChanged();
    partial void OnIPChanging(string value);
    partial void OnIPChanged();
    partial void OnEKeyChanging(System.Nullable<System.Guid> value);
    partial void OnEKeyChanged();
    partial void OnNotesChanging(string value);
    partial void OnNotesChanged();
    partial void OnUserIDChanging(System.Nullable<int> value);
    partial void OnUserIDChanged();
    #endregion
		
		public Error()
		{
			this._User = default(EntityRef<User>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int ID
		{
			get
			{
				return this._ID;
			}
			set
			{
				if ((this._ID != value))
				{
					this.OnIDChanging(value);
					this.SendPropertyChanging();
					this._ID = value;
					this.SendPropertyChanged("ID");
					this.OnIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Source", DbType="NVarChar(255) NOT NULL", CanBeNull=false)]
		public string Source
		{
			get
			{
				return this._Source;
			}
			set
			{
				if ((this._Source != value))
				{
					this.OnSourceChanging(value);
					this.SendPropertyChanging();
					this._Source = value;
					this.SendPropertyChanged("Source");
					this.OnSourceChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Message", DbType="NVarChar(MAX) NOT NULL", CanBeNull=false)]
		public string Message
		{
			get
			{
				return this._Message;
			}
			set
			{
				if ((this._Message != value))
				{
					this.OnMessageChanging(value);
					this.SendPropertyChanging();
					this._Message = value;
					this.SendPropertyChanged("Message");
					this.OnMessageChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Description", DbType="NVarChar(MAX)")]
		public string Description
		{
			get
			{
				return this._Description;
			}
			set
			{
				if ((this._Description != value))
				{
					this.OnDescriptionChanging(value);
					this.SendPropertyChanging();
					this._Description = value;
					this.SendPropertyChanged("Description");
					this.OnDescriptionChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateCreated", DbType="DateTime NOT NULL")]
		public System.DateTime DateCreated
		{
			get
			{
				return this._DateCreated;
			}
			set
			{
				if ((this._DateCreated != value))
				{
					this.OnDateCreatedChanging(value);
					this.SendPropertyChanging();
					this._DateCreated = value;
					this.SendPropertyChanged("DateCreated");
					this.OnDateCreatedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IP", DbType="NVarChar(50)")]
		public string IP
		{
			get
			{
				return this._IP;
			}
			set
			{
				if ((this._IP != value))
				{
					this.OnIPChanging(value);
					this.SendPropertyChanging();
					this._IP = value;
					this.SendPropertyChanged("IP");
					this.OnIPChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EKey", DbType="UniqueIdentifier")]
		public System.Nullable<System.Guid> EKey
		{
			get
			{
				return this._EKey;
			}
			set
			{
				if ((this._EKey != value))
				{
					this.OnEKeyChanging(value);
					this.SendPropertyChanging();
					this._EKey = value;
					this.SendPropertyChanged("EKey");
					this.OnEKeyChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Notes", DbType="Text", UpdateCheck=UpdateCheck.Never)]
		public string Notes
		{
			get
			{
				return this._Notes;
			}
			set
			{
				if ((this._Notes != value))
				{
					this.OnNotesChanging(value);
					this.SendPropertyChanging();
					this._Notes = value;
					this.SendPropertyChanged("Notes");
					this.OnNotesChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserID", DbType="Int")]
		public System.Nullable<int> UserID
		{
			get
			{
				return this._UserID;
			}
			set
			{
				if ((this._UserID != value))
				{
					if (this._User.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnUserIDChanging(value);
					this.SendPropertyChanging();
					this._UserID = value;
					this.SendPropertyChanged("UserID");
					this.OnUserIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_Error", Storage="_User", ThisKey="UserID", OtherKey="UserID", IsForeignKey=true, DeleteRule="CASCADE")]
		public User User
		{
			get
			{
				return this._User.Entity;
			}
			set
			{
				User previousValue = this._User.Entity;
				if (((previousValue != value) 
							|| (this._User.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._User.Entity = null;
						previousValue.Errors.Remove(this);
					}
					this._User.Entity = value;
					if ((value != null))
					{
						value.Errors.Add(this);
						this._UserID = value.UserID;
					}
					else
					{
						this._UserID = default(Nullable<int>);
					}
					this.SendPropertyChanged("User");
				}
			}
		}
		
		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));
			}
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Geo_Image")]
	public partial class Geo_Image : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _GeoID;
		
		private int _ImageID;
		
		private int _Ordering;
		
		private System.Nullable<System.DateTime> _Deleted;
		
		private System.DateTime _Created;
		
		private EntityRef<Image> _Image;
		
		private EntityRef<Geo> _Geo;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnGeoIDChanging(int value);
    partial void OnGeoIDChanged();
    partial void OnImageIDChanging(int value);
    partial void OnImageIDChanged();
    partial void OnOrderingChanging(int value);
    partial void OnOrderingChanged();
    partial void OnDeletedChanging(System.Nullable<System.DateTime> value);
    partial void OnDeletedChanged();
    partial void OnCreatedChanging(System.DateTime value);
    partial void OnCreatedChanged();
    #endregion
		
		public Geo_Image()
		{
			this._Image = default(EntityRef<Image>);
			this._Geo = default(EntityRef<Geo>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GeoID", DbType="Int NOT NULL", IsPrimaryKey=true)]
		public int GeoID
		{
			get
			{
				return this._GeoID;
			}
			set
			{
				if ((this._GeoID != value))
				{
					if (this._Geo.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnGeoIDChanging(value);
					this.SendPropertyChanging();
					this._GeoID = value;
					this.SendPropertyChanged("GeoID");
					this.OnGeoIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ImageID", DbType="Int NOT NULL", IsPrimaryKey=true)]
		public int ImageID
		{
			get
			{
				return this._ImageID;
			}
			set
			{
				if ((this._ImageID != value))
				{
					if (this._Image.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnImageIDChanging(value);
					this.SendPropertyChanging();
					this._ImageID = value;
					this.SendPropertyChanged("ImageID");
					this.OnImageIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Ordering", DbType="Int NOT NULL")]
		public int Ordering
		{
			get
			{
				return this._Ordering;
			}
			set
			{
				if ((this._Ordering != value))
				{
					this.OnOrderingChanging(value);
					this.SendPropertyChanging();
					this._Ordering = value;
					this.SendPropertyChanged("Ordering");
					this.OnOrderingChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Deleted", DbType="DateTime")]
		public System.Nullable<System.DateTime> Deleted
		{
			get
			{
				return this._Deleted;
			}
			set
			{
				if ((this._Deleted != value))
				{
					this.OnDeletedChanging(value);
					this.SendPropertyChanging();
					this._Deleted = value;
					this.SendPropertyChanged("Deleted");
					this.OnDeletedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Created", DbType="DateTime NOT NULL")]
		public System.DateTime Created
		{
			get
			{
				return this._Created;
			}
			set
			{
				if ((this._Created != value))
				{
					this.OnCreatedChanging(value);
					this.SendPropertyChanging();
					this._Created = value;
					this.SendPropertyChanged("Created");
					this.OnCreatedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Image_Geo_Image", Storage="_Image", ThisKey="ImageID", OtherKey="ImageID", IsForeignKey=true)]
		public Image Image
		{
			get
			{
				return this._Image.Entity;
			}
			set
			{
				Image previousValue = this._Image.Entity;
				if (((previousValue != value) 
							|| (this._Image.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Image.Entity = null;
						previousValue.Geo_Images.Remove(this);
					}
					this._Image.Entity = value;
					if ((value != null))
					{
						value.Geo_Images.Add(this);
						this._ImageID = value.ImageID;
					}
					else
					{
						this._ImageID = default(int);
					}
					this.SendPropertyChanged("Image");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Geo_Geo_Image", Storage="_Geo", ThisKey="GeoID", OtherKey="GeoID", IsForeignKey=true)]
		public Geo Geo
		{
			get
			{
				return this._Geo.Entity;
			}
			set
			{
				Geo previousValue = this._Geo.Entity;
				if (((previousValue != value) 
							|| (this._Geo.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Geo.Entity = null;
						previousValue.Geo_Images.Remove(this);
					}
					this._Geo.Entity = value;
					if ((value != null))
					{
						value.Geo_Images.Add(this);
						this._GeoID = value.GeoID;
					}
					else
					{
						this._GeoID = default(int);
					}
					this.SendPropertyChanged("Geo");
				}
			}
		}
		
		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));
			}
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Image")]
	public partial class Image : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _ImageID;
		
		private string _Text;
		
		private System.Nullable<short> _Year;
		
		private bool _YearIsApprox;
		
		private string _Photographer;
		
		private string _Licensee;
		
		private System.DateTime _Created;
		
		private System.Nullable<System.DateTime> _Deleted;
		
		private int _UserID;
		
		private EntitySet<Geo_Image> _Geo_Images;
		
		private EntitySet<Tag_Image> _Tag_Images;
		
		private EntityRef<User> _User;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnImageIDChanging(int value);
    partial void OnImageIDChanged();
    partial void OnTextChanging(string value);
    partial void OnTextChanged();
    partial void OnYearChanging(System.Nullable<short> value);
    partial void OnYearChanged();
    partial void OnYearIsApproxChanging(bool value);
    partial void OnYearIsApproxChanged();
    partial void OnPhotographerChanging(string value);
    partial void OnPhotographerChanged();
    partial void OnLicenseeChanging(string value);
    partial void OnLicenseeChanged();
    partial void OnCreatedChanging(System.DateTime value);
    partial void OnCreatedChanged();
    partial void OnDeletedChanging(System.Nullable<System.DateTime> value);
    partial void OnDeletedChanged();
    partial void OnUserIDChanging(int value);
    partial void OnUserIDChanged();
    #endregion
		
		public Image()
		{
			this._Geo_Images = new EntitySet<Geo_Image>(new Action<Geo_Image>(this.attach_Geo_Images), new Action<Geo_Image>(this.detach_Geo_Images));
			this._Tag_Images = new EntitySet<Tag_Image>(new Action<Tag_Image>(this.attach_Tag_Images), new Action<Tag_Image>(this.detach_Tag_Images));
			this._User = default(EntityRef<User>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ImageID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int ImageID
		{
			get
			{
				return this._ImageID;
			}
			set
			{
				if ((this._ImageID != value))
				{
					this.OnImageIDChanging(value);
					this.SendPropertyChanging();
					this._ImageID = value;
					this.SendPropertyChanged("ImageID");
					this.OnImageIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Text", DbType="VarChar(255)")]
		public string Text
		{
			get
			{
				return this._Text;
			}
			set
			{
				if ((this._Text != value))
				{
					this.OnTextChanging(value);
					this.SendPropertyChanging();
					this._Text = value;
					this.SendPropertyChanged("Text");
					this.OnTextChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Year", DbType="SmallInt")]
		public System.Nullable<short> Year
		{
			get
			{
				return this._Year;
			}
			set
			{
				if ((this._Year != value))
				{
					this.OnYearChanging(value);
					this.SendPropertyChanging();
					this._Year = value;
					this.SendPropertyChanged("Year");
					this.OnYearChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_YearIsApprox", DbType="Bit NOT NULL")]
		public bool YearIsApprox
		{
			get
			{
				return this._YearIsApprox;
			}
			set
			{
				if ((this._YearIsApprox != value))
				{
					this.OnYearIsApproxChanging(value);
					this.SendPropertyChanging();
					this._YearIsApprox = value;
					this.SendPropertyChanged("YearIsApprox");
					this.OnYearIsApproxChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Photographer", DbType="VarChar(100)")]
		public string Photographer
		{
			get
			{
				return this._Photographer;
			}
			set
			{
				if ((this._Photographer != value))
				{
					this.OnPhotographerChanging(value);
					this.SendPropertyChanging();
					this._Photographer = value;
					this.SendPropertyChanged("Photographer");
					this.OnPhotographerChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Licensee", DbType="VarChar(255)")]
		public string Licensee
		{
			get
			{
				return this._Licensee;
			}
			set
			{
				if ((this._Licensee != value))
				{
					this.OnLicenseeChanging(value);
					this.SendPropertyChanging();
					this._Licensee = value;
					this.SendPropertyChanged("Licensee");
					this.OnLicenseeChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Created", DbType="DateTime NOT NULL")]
		public System.DateTime Created
		{
			get
			{
				return this._Created;
			}
			set
			{
				if ((this._Created != value))
				{
					this.OnCreatedChanging(value);
					this.SendPropertyChanging();
					this._Created = value;
					this.SendPropertyChanged("Created");
					this.OnCreatedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Deleted", DbType="DateTime")]
		public System.Nullable<System.DateTime> Deleted
		{
			get
			{
				return this._Deleted;
			}
			set
			{
				if ((this._Deleted != value))
				{
					this.OnDeletedChanging(value);
					this.SendPropertyChanging();
					this._Deleted = value;
					this.SendPropertyChanged("Deleted");
					this.OnDeletedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserID", DbType="Int NOT NULL")]
		public int UserID
		{
			get
			{
				return this._UserID;
			}
			set
			{
				if ((this._UserID != value))
				{
					if (this._User.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnUserIDChanging(value);
					this.SendPropertyChanging();
					this._UserID = value;
					this.SendPropertyChanged("UserID");
					this.OnUserIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Image_Geo_Image", Storage="_Geo_Images", ThisKey="ImageID", OtherKey="ImageID")]
		public EntitySet<Geo_Image> Geo_Images
		{
			get
			{
				return this._Geo_Images;
			}
			set
			{
				this._Geo_Images.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Image_Tag_Image", Storage="_Tag_Images", ThisKey="ImageID", OtherKey="ImageID")]
		public EntitySet<Tag_Image> Tag_Images
		{
			get
			{
				return this._Tag_Images;
			}
			set
			{
				this._Tag_Images.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_Image", Storage="_User", ThisKey="UserID", OtherKey="UserID", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]
		public User User
		{
			get
			{
				return this._User.Entity;
			}
			set
			{
				User previousValue = this._User.Entity;
				if (((previousValue != value) 
							|| (this._User.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._User.Entity = null;
						previousValue.Images.Remove(this);
					}
					this._User.Entity = value;
					if ((value != null))
					{
						value.Images.Add(this);
						this._UserID = value.UserID;
					}
					else
					{
						this._UserID = default(int);
					}
					this.SendPropertyChanged("User");
				}
			}
		}
		
		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));
			}
		}
		
		private void attach_Geo_Images(Geo_Image entity)
		{
			this.SendPropertyChanging();
			entity.Image = this;
		}
		
		private void detach_Geo_Images(Geo_Image entity)
		{
			this.SendPropertyChanging();
			entity.Image = null;
		}
		
		private void attach_Tag_Images(Tag_Image entity)
		{
			this.SendPropertyChanging();
			entity.Image = this;
		}
		
		private void detach_Tag_Images(Tag_Image entity)
		{
			this.SendPropertyChanging();
			entity.Image = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Licens")]
	public partial class Licen : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private byte _LicensID;
		
		private string _Text;
		
		private string _Url;
		
		private short _Ordering;
		
		private int _TagID;
		
		private EntityRef<Tag> _Tag;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnLicensIDChanging(byte value);
    partial void OnLicensIDChanged();
    partial void OnTextChanging(string value);
    partial void OnTextChanged();
    partial void OnUrlChanging(string value);
    partial void OnUrlChanged();
    partial void OnOrderingChanging(short value);
    partial void OnOrderingChanged();
    partial void OnTagIDChanging(int value);
    partial void OnTagIDChanged();
    #endregion
		
		public Licen()
		{
			this._Tag = default(EntityRef<Tag>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LicensID", DbType="TinyInt NOT NULL", IsPrimaryKey=true)]
		public byte LicensID
		{
			get
			{
				return this._LicensID;
			}
			set
			{
				if ((this._LicensID != value))
				{
					this.OnLicensIDChanging(value);
					this.SendPropertyChanging();
					this._LicensID = value;
					this.SendPropertyChanged("LicensID");
					this.OnLicensIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Text", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
		public string Text
		{
			get
			{
				return this._Text;
			}
			set
			{
				if ((this._Text != value))
				{
					this.OnTextChanging(value);
					this.SendPropertyChanging();
					this._Text = value;
					this.SendPropertyChanged("Text");
					this.OnTextChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Url", DbType="NVarChar(200) NOT NULL", CanBeNull=false)]
		public string Url
		{
			get
			{
				return this._Url;
			}
			set
			{
				if ((this._Url != value))
				{
					this.OnUrlChanging(value);
					this.SendPropertyChanging();
					this._Url = value;
					this.SendPropertyChanged("Url");
					this.OnUrlChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Ordering", DbType="SmallInt NOT NULL")]
		public short Ordering
		{
			get
			{
				return this._Ordering;
			}
			set
			{
				if ((this._Ordering != value))
				{
					this.OnOrderingChanging(value);
					this.SendPropertyChanging();
					this._Ordering = value;
					this.SendPropertyChanged("Ordering");
					this.OnOrderingChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TagID", DbType="Int NOT NULL")]
		public int TagID
		{
			get
			{
				return this._TagID;
			}
			set
			{
				if ((this._TagID != value))
				{
					if (this._Tag.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnTagIDChanging(value);
					this.SendPropertyChanging();
					this._TagID = value;
					this.SendPropertyChanged("TagID");
					this.OnTagIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Tag_Licen", Storage="_Tag", ThisKey="TagID", OtherKey="TagID", IsForeignKey=true)]
		public Tag Tag
		{
			get
			{
				return this._Tag.Entity;
			}
			set
			{
				Tag previousValue = this._Tag.Entity;
				if (((previousValue != value) 
							|| (this._Tag.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Tag.Entity = null;
						previousValue.Licens.Remove(this);
					}
					this._Tag.Entity = value;
					if ((value != null))
					{
						value.Licens.Add(this);
						this._TagID = value.TagID;
					}
					else
					{
						this._TagID = default(int);
					}
					this.SendPropertyChanged("Tag");
				}
			}
		}
		
		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));
			}
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.[Log]")]
	public partial class Log : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private decimal _ID;
		
		private string _Item;
		
		private string _Value;
		
		private int _UserID;
		
		private System.DateTime _DateCreated;
		
		private int _TypeID;
		
		private int _SourceID;
		
		private string _Notes;
		
		private EntityRef<LogSource> _LogSource;
		
		private EntityRef<LogType> _LogType;
		
		private EntityRef<User> _User;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnIDChanging(decimal value);
    partial void OnIDChanged();
    partial void OnItemChanging(string value);
    partial void OnItemChanged();
    partial void OnValueChanging(string value);
    partial void OnValueChanged();
    partial void OnUserIDChanging(int value);
    partial void OnUserIDChanged();
    partial void OnDateCreatedChanging(System.DateTime value);
    partial void OnDateCreatedChanged();
    partial void OnTypeIDChanging(int value);
    partial void OnTypeIDChanged();
    partial void OnSourceIDChanging(int value);
    partial void OnSourceIDChanged();
    partial void OnNotesChanging(string value);
    partial void OnNotesChanged();
    #endregion
		
		public Log()
		{
			this._LogSource = default(EntityRef<LogSource>);
			this._LogType = default(EntityRef<LogType>);
			this._User = default(EntityRef<User>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ID", AutoSync=AutoSync.OnInsert, DbType="Decimal(18,0) NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public decimal ID
		{
			get
			{
				return this._ID;
			}
			set
			{
				if ((this._ID != value))
				{
					this.OnIDChanging(value);
					this.SendPropertyChanging();
					this._ID = value;
					this.SendPropertyChanged("ID");
					this.OnIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Item", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
		public string Item
		{
			get
			{
				return this._Item;
			}
			set
			{
				if ((this._Item != value))
				{
					this.OnItemChanging(value);
					this.SendPropertyChanging();
					this._Item = value;
					this.SendPropertyChanged("Item");
					this.OnItemChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Value", DbType="Text NOT NULL", CanBeNull=false, UpdateCheck=UpdateCheck.Never)]
		public string Value
		{
			get
			{
				return this._Value;
			}
			set
			{
				if ((this._Value != value))
				{
					this.OnValueChanging(value);
					this.SendPropertyChanging();
					this._Value = value;
					this.SendPropertyChanged("Value");
					this.OnValueChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserID", DbType="Int NOT NULL")]
		public int UserID
		{
			get
			{
				return this._UserID;
			}
			set
			{
				if ((this._UserID != value))
				{
					if (this._User.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnUserIDChanging(value);
					this.SendPropertyChanging();
					this._UserID = value;
					this.SendPropertyChanged("UserID");
					this.OnUserIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateCreated", DbType="DateTime NOT NULL")]
		public System.DateTime DateCreated
		{
			get
			{
				return this._DateCreated;
			}
			set
			{
				if ((this._DateCreated != value))
				{
					this.OnDateCreatedChanging(value);
					this.SendPropertyChanging();
					this._DateCreated = value;
					this.SendPropertyChanged("DateCreated");
					this.OnDateCreatedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TypeID", DbType="Int NOT NULL")]
		public int TypeID
		{
			get
			{
				return this._TypeID;
			}
			set
			{
				if ((this._TypeID != value))
				{
					if (this._LogType.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnTypeIDChanging(value);
					this.SendPropertyChanging();
					this._TypeID = value;
					this.SendPropertyChanged("TypeID");
					this.OnTypeIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SourceID", DbType="Int NOT NULL")]
		public int SourceID
		{
			get
			{
				return this._SourceID;
			}
			set
			{
				if ((this._SourceID != value))
				{
					if (this._LogSource.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnSourceIDChanging(value);
					this.SendPropertyChanging();
					this._SourceID = value;
					this.SendPropertyChanged("SourceID");
					this.OnSourceIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Notes", DbType="Text", UpdateCheck=UpdateCheck.Never)]
		public string Notes
		{
			get
			{
				return this._Notes;
			}
			set
			{
				if ((this._Notes != value))
				{
					this.OnNotesChanging(value);
					this.SendPropertyChanging();
					this._Notes = value;
					this.SendPropertyChanged("Notes");
					this.OnNotesChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="LogSource_Log", Storage="_LogSource", ThisKey="SourceID", OtherKey="ID", IsForeignKey=true)]
		public LogSource LogSource
		{
			get
			{
				return this._LogSource.Entity;
			}
			set
			{
				LogSource previousValue = this._LogSource.Entity;
				if (((previousValue != value) 
							|| (this._LogSource.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._LogSource.Entity = null;
						previousValue.Logs.Remove(this);
					}
					this._LogSource.Entity = value;
					if ((value != null))
					{
						value.Logs.Add(this);
						this._SourceID = value.ID;
					}
					else
					{
						this._SourceID = default(int);
					}
					this.SendPropertyChanged("LogSource");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="LogType_Log", Storage="_LogType", ThisKey="TypeID", OtherKey="ID", IsForeignKey=true)]
		public LogType LogType
		{
			get
			{
				return this._LogType.Entity;
			}
			set
			{
				LogType previousValue = this._LogType.Entity;
				if (((previousValue != value) 
							|| (this._LogType.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._LogType.Entity = null;
						previousValue.Logs.Remove(this);
					}
					this._LogType.Entity = value;
					if ((value != null))
					{
						value.Logs.Add(this);
						this._TypeID = value.ID;
					}
					else
					{
						this._TypeID = default(int);
					}
					this.SendPropertyChanged("LogType");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_Log", Storage="_User", ThisKey="UserID", OtherKey="UserID", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]
		public User User
		{
			get
			{
				return this._User.Entity;
			}
			set
			{
				User previousValue = this._User.Entity;
				if (((previousValue != value) 
							|| (this._User.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._User.Entity = null;
						previousValue.Logs.Remove(this);
					}
					this._User.Entity = value;
					if ((value != null))
					{
						value.Logs.Add(this);
						this._UserID = value.UserID;
					}
					else
					{
						this._UserID = default(int);
					}
					this.SendPropertyChanged("User");
				}
			}
		}
		
		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));
			}
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.LogSource")]
	public partial class LogSource : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _ID;
		
		private string _Name;
		
		private string _Description;
		
		private EntitySet<Log> _Logs;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnIDChanging(int value);
    partial void OnIDChanged();
    partial void OnNameChanging(string value);
    partial void OnNameChanged();
    partial void OnDescriptionChanging(string value);
    partial void OnDescriptionChanged();
    #endregion
		
		public LogSource()
		{
			this._Logs = new EntitySet<Log>(new Action<Log>(this.attach_Logs), new Action<Log>(this.detach_Logs));
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int ID
		{
			get
			{
				return this._ID;
			}
			set
			{
				if ((this._ID != value))
				{
					this.OnIDChanging(value);
					this.SendPropertyChanging();
					this._ID = value;
					this.SendPropertyChanged("ID");
					this.OnIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
		public string Name
		{
			get
			{
				return this._Name;
			}
			set
			{
				if ((this._Name != value))
				{
					this.OnNameChanging(value);
					this.SendPropertyChanging();
					this._Name = value;
					this.SendPropertyChanged("Name");
					this.OnNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Description", DbType="Text", UpdateCheck=UpdateCheck.Never)]
		public string Description
		{
			get
			{
				return this._Description;
			}
			set
			{
				if ((this._Description != value))
				{
					this.OnDescriptionChanging(value);
					this.SendPropertyChanging();
					this._Description = value;
					this.SendPropertyChanged("Description");
					this.OnDescriptionChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="LogSource_Log", Storage="_Logs", ThisKey="ID", OtherKey="SourceID")]
		public EntitySet<Log> Logs
		{
			get
			{
				return this._Logs;
			}
			set
			{
				this._Logs.Assign(value);
			}
		}
		
		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));
			}
		}
		
		private void attach_Logs(Log entity)
		{
			this.SendPropertyChanging();
			entity.LogSource = this;
		}
		
		private void detach_Logs(Log entity)
		{
			this.SendPropertyChanging();
			entity.LogSource = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.LogType")]
	public partial class LogType : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _ID;
		
		private string _Name;
		
		private string _Description;
		
		private EntitySet<Log> _Logs;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnIDChanging(int value);
    partial void OnIDChanged();
    partial void OnNameChanging(string value);
    partial void OnNameChanged();
    partial void OnDescriptionChanging(string value);
    partial void OnDescriptionChanged();
    #endregion
		
		public LogType()
		{
			this._Logs = new EntitySet<Log>(new Action<Log>(this.attach_Logs), new Action<Log>(this.detach_Logs));
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int ID
		{
			get
			{
				return this._ID;
			}
			set
			{
				if ((this._ID != value))
				{
					this.OnIDChanging(value);
					this.SendPropertyChanging();
					this._ID = value;
					this.SendPropertyChanged("ID");
					this.OnIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
		public string Name
		{
			get
			{
				return this._Name;
			}
			set
			{
				if ((this._Name != value))
				{
					this.OnNameChanging(value);
					this.SendPropertyChanging();
					this._Name = value;
					this.SendPropertyChanged("Name");
					this.OnNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Description", DbType="Text", UpdateCheck=UpdateCheck.Never)]
		public string Description
		{
			get
			{
				return this._Description;
			}
			set
			{
				if ((this._Description != value))
				{
					this.OnDescriptionChanging(value);
					this.SendPropertyChanging();
					this._Description = value;
					this.SendPropertyChanged("Description");
					this.OnDescriptionChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="LogType_Log", Storage="_Logs", ThisKey="ID", OtherKey="TypeID")]
		public EntitySet<Log> Logs
		{
			get
			{
				return this._Logs;
			}
			set
			{
				this._Logs.Assign(value);
			}
		}
		
		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));
			}
		}
		
		private void attach_Logs(Log entity)
		{
			this.SendPropertyChanging();
			entity.LogType = this;
		}
		
		private void detach_Logs(Log entity)
		{
			this.SendPropertyChanging();
			entity.LogType = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Region")]
	public partial class Region : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _RegionID;
		
		private int _RegionTypeID;
		
		private string _Name;
		
		private int _PeriodStart;
		
		private int _PeriodEnd;
		
		private EntitySet<Region_Region> _Region_Regions;
		
		private EntitySet<Region_Region> _Region_Regions1;
		
		private EntitySet<Region_RegionSource> _Region_RegionSources;
		
		private EntityRef<RegionType> _RegionType;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnRegionIDChanging(int value);
    partial void OnRegionIDChanged();
    partial void OnRegionTypeIDChanging(int value);
    partial void OnRegionTypeIDChanged();
    partial void OnNameChanging(string value);
    partial void OnNameChanged();
    partial void OnPeriodStartChanging(int value);
    partial void OnPeriodStartChanged();
    partial void OnPeriodEndChanging(int value);
    partial void OnPeriodEndChanged();
    #endregion
		
		public Region()
		{
			this._Region_Regions = new EntitySet<Region_Region>(new Action<Region_Region>(this.attach_Region_Regions), new Action<Region_Region>(this.detach_Region_Regions));
			this._Region_Regions1 = new EntitySet<Region_Region>(new Action<Region_Region>(this.attach_Region_Regions1), new Action<Region_Region>(this.detach_Region_Regions1));
			this._Region_RegionSources = new EntitySet<Region_RegionSource>(new Action<Region_RegionSource>(this.attach_Region_RegionSources), new Action<Region_RegionSource>(this.detach_Region_RegionSources));
			this._RegionType = default(EntityRef<RegionType>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RegionID", DbType="Int NOT NULL", IsPrimaryKey=true)]
		public int RegionID
		{
			get
			{
				return this._RegionID;
			}
			set
			{
				if ((this._RegionID != value))
				{
					this.OnRegionIDChanging(value);
					this.SendPropertyChanging();
					this._RegionID = value;
					this.SendPropertyChanged("RegionID");
					this.OnRegionIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RegionTypeID", DbType="Int NOT NULL")]
		public int RegionTypeID
		{
			get
			{
				return this._RegionTypeID;
			}
			set
			{
				if ((this._RegionTypeID != value))
				{
					if (this._RegionType.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnRegionTypeIDChanging(value);
					this.SendPropertyChanging();
					this._RegionTypeID = value;
					this.SendPropertyChanged("RegionTypeID");
					this.OnRegionTypeIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="VarChar(150) NOT NULL", CanBeNull=false)]
		public string Name
		{
			get
			{
				return this._Name;
			}
			set
			{
				if ((this._Name != value))
				{
					this.OnNameChanging(value);
					this.SendPropertyChanging();
					this._Name = value;
					this.SendPropertyChanged("Name");
					this.OnNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PeriodStart", DbType="Int NOT NULL")]
		public int PeriodStart
		{
			get
			{
				return this._PeriodStart;
			}
			set
			{
				if ((this._PeriodStart != value))
				{
					this.OnPeriodStartChanging(value);
					this.SendPropertyChanging();
					this._PeriodStart = value;
					this.SendPropertyChanged("PeriodStart");
					this.OnPeriodStartChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PeriodEnd", DbType="Int NOT NULL")]
		public int PeriodEnd
		{
			get
			{
				return this._PeriodEnd;
			}
			set
			{
				if ((this._PeriodEnd != value))
				{
					this.OnPeriodEndChanging(value);
					this.SendPropertyChanging();
					this._PeriodEnd = value;
					this.SendPropertyChanged("PeriodEnd");
					this.OnPeriodEndChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Region_Region_Region", Storage="_Region_Regions", ThisKey="RegionID", OtherKey="RegionID")]
		public EntitySet<Region_Region> Region_Regions
		{
			get
			{
				return this._Region_Regions;
			}
			set
			{
				this._Region_Regions.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Region_Region_Region1", Storage="_Region_Regions1", ThisKey="RegionID", OtherKey="ChildRegionID")]
		public EntitySet<Region_Region> Region_Regions1
		{
			get
			{
				return this._Region_Regions1;
			}
			set
			{
				this._Region_Regions1.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Region_Region_RegionSource", Storage="_Region_RegionSources", ThisKey="RegionID", OtherKey="RegionID")]
		public EntitySet<Region_RegionSource> Region_RegionSources
		{
			get
			{
				return this._Region_RegionSources;
			}
			set
			{
				this._Region_RegionSources.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="RegionType_Region", Storage="_RegionType", ThisKey="RegionTypeID", OtherKey="RegionTypeID", IsForeignKey=true)]
		public RegionType RegionType
		{
			get
			{
				return this._RegionType.Entity;
			}
			set
			{
				RegionType previousValue = this._RegionType.Entity;
				if (((previousValue != value) 
							|| (this._RegionType.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._RegionType.Entity = null;
						previousValue.Regions.Remove(this);
					}
					this._RegionType.Entity = value;
					if ((value != null))
					{
						value.Regions.Add(this);
						this._RegionTypeID = value.RegionTypeID;
					}
					else
					{
						this._RegionTypeID = default(int);
					}
					this.SendPropertyChanged("RegionType");
				}
			}
		}
		
		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));
			}
		}
		
		private void attach_Region_Regions(Region_Region entity)
		{
			this.SendPropertyChanging();
			entity.Region = this;
		}
		
		private void detach_Region_Regions(Region_Region entity)
		{
			this.SendPropertyChanging();
			entity.Region = null;
		}
		
		private void attach_Region_Regions1(Region_Region entity)
		{
			this.SendPropertyChanging();
			entity.Region1 = this;
		}
		
		private void detach_Region_Regions1(Region_Region entity)
		{
			this.SendPropertyChanging();
			entity.Region1 = null;
		}
		
		private void attach_Region_RegionSources(Region_RegionSource entity)
		{
			this.SendPropertyChanging();
			entity.Region = this;
		}
		
		private void detach_Region_RegionSources(Region_RegionSource entity)
		{
			this.SendPropertyChanging();
			entity.Region = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Region_Region")]
	public partial class Region_Region : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _RegionID;
		
		private int _ChildRegionID;
		
		private EntityRef<Region> _Region;
		
		private EntityRef<Region> _Region1;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnRegionIDChanging(int value);
    partial void OnRegionIDChanged();
    partial void OnChildRegionIDChanging(int value);
    partial void OnChildRegionIDChanged();
    #endregion
		
		public Region_Region()
		{
			this._Region = default(EntityRef<Region>);
			this._Region1 = default(EntityRef<Region>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RegionID", DbType="Int NOT NULL", IsPrimaryKey=true)]
		public int RegionID
		{
			get
			{
				return this._RegionID;
			}
			set
			{
				if ((this._RegionID != value))
				{
					if (this._Region.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnRegionIDChanging(value);
					this.SendPropertyChanging();
					this._RegionID = value;
					this.SendPropertyChanged("RegionID");
					this.OnRegionIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ChildRegionID", DbType="Int NOT NULL", IsPrimaryKey=true)]
		public int ChildRegionID
		{
			get
			{
				return this._ChildRegionID;
			}
			set
			{
				if ((this._ChildRegionID != value))
				{
					if (this._Region1.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnChildRegionIDChanging(value);
					this.SendPropertyChanging();
					this._ChildRegionID = value;
					this.SendPropertyChanged("ChildRegionID");
					this.OnChildRegionIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Region_Region_Region", Storage="_Region", ThisKey="RegionID", OtherKey="RegionID", IsForeignKey=true)]
		public Region Region
		{
			get
			{
				return this._Region.Entity;
			}
			set
			{
				Region previousValue = this._Region.Entity;
				if (((previousValue != value) 
							|| (this._Region.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Region.Entity = null;
						previousValue.Region_Regions.Remove(this);
					}
					this._Region.Entity = value;
					if ((value != null))
					{
						value.Region_Regions.Add(this);
						this._RegionID = value.RegionID;
					}
					else
					{
						this._RegionID = default(int);
					}
					this.SendPropertyChanged("Region");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Region_Region_Region1", Storage="_Region1", ThisKey="ChildRegionID", OtherKey="RegionID", IsForeignKey=true)]
		public Region Region1
		{
			get
			{
				return this._Region1.Entity;
			}
			set
			{
				Region previousValue = this._Region1.Entity;
				if (((previousValue != value) 
							|| (this._Region1.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Region1.Entity = null;
						previousValue.Region_Regions1.Remove(this);
					}
					this._Region1.Entity = value;
					if ((value != null))
					{
						value.Region_Regions1.Add(this);
						this._ChildRegionID = value.RegionID;
					}
					else
					{
						this._ChildRegionID = default(int);
					}
					this.SendPropertyChanged("Region1");
				}
			}
		}
		
		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));
			}
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Region_RegionSource")]
	public partial class Region_RegionSource : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _RegionID;
		
		private int _RegionSourceID;
		
		private EntityRef<Region> _Region;
		
		private EntityRef<RegionSource> _RegionSource;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnRegionIDChanging(int value);
    partial void OnRegionIDChanged();
    partial void OnRegionSourceIDChanging(int value);
    partial void OnRegionSourceIDChanged();
    #endregion
		
		public Region_RegionSource()
		{
			this._Region = default(EntityRef<Region>);
			this._RegionSource = default(EntityRef<RegionSource>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RegionID", DbType="Int NOT NULL", IsPrimaryKey=true)]
		public int RegionID
		{
			get
			{
				return this._RegionID;
			}
			set
			{
				if ((this._RegionID != value))
				{
					if (this._Region.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnRegionIDChanging(value);
					this.SendPropertyChanging();
					this._RegionID = value;
					this.SendPropertyChanged("RegionID");
					this.OnRegionIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RegionSourceID", DbType="Int NOT NULL", IsPrimaryKey=true)]
		public int RegionSourceID
		{
			get
			{
				return this._RegionSourceID;
			}
			set
			{
				if ((this._RegionSourceID != value))
				{
					if (this._RegionSource.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnRegionSourceIDChanging(value);
					this.SendPropertyChanging();
					this._RegionSourceID = value;
					this.SendPropertyChanged("RegionSourceID");
					this.OnRegionSourceIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Region_Region_RegionSource", Storage="_Region", ThisKey="RegionID", OtherKey="RegionID", IsForeignKey=true)]
		public Region Region
		{
			get
			{
				return this._Region.Entity;
			}
			set
			{
				Region previousValue = this._Region.Entity;
				if (((previousValue != value) 
							|| (this._Region.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Region.Entity = null;
						previousValue.Region_RegionSources.Remove(this);
					}
					this._Region.Entity = value;
					if ((value != null))
					{
						value.Region_RegionSources.Add(this);
						this._RegionID = value.RegionID;
					}
					else
					{
						this._RegionID = default(int);
					}
					this.SendPropertyChanged("Region");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="RegionSource_Region_RegionSource", Storage="_RegionSource", ThisKey="RegionSourceID", OtherKey="RegionSourceID", IsForeignKey=true)]
		public RegionSource RegionSource
		{
			get
			{
				return this._RegionSource.Entity;
			}
			set
			{
				RegionSource previousValue = this._RegionSource.Entity;
				if (((previousValue != value) 
							|| (this._RegionSource.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._RegionSource.Entity = null;
						previousValue.Region_RegionSources.Remove(this);
					}
					this._RegionSource.Entity = value;
					if ((value != null))
					{
						value.Region_RegionSources.Add(this);
						this._RegionSourceID = value.RegionSourceID;
					}
					else
					{
						this._RegionSourceID = default(int);
					}
					this.SendPropertyChanged("RegionSource");
				}
			}
		}
		
		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));
			}
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.RegionSource")]
	public partial class RegionSource : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _RegionSourceID;
		
		private string _ShortName;
		
		private string _Name;
		
		private EntitySet<Region_RegionSource> _Region_RegionSources;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnRegionSourceIDChanging(int value);
    partial void OnRegionSourceIDChanged();
    partial void OnShortNameChanging(string value);
    partial void OnShortNameChanged();
    partial void OnNameChanging(string value);
    partial void OnNameChanged();
    #endregion
		
		public RegionSource()
		{
			this._Region_RegionSources = new EntitySet<Region_RegionSource>(new Action<Region_RegionSource>(this.attach_Region_RegionSources), new Action<Region_RegionSource>(this.detach_Region_RegionSources));
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RegionSourceID", DbType="Int NOT NULL", IsPrimaryKey=true)]
		public int RegionSourceID
		{
			get
			{
				return this._RegionSourceID;
			}
			set
			{
				if ((this._RegionSourceID != value))
				{
					this.OnRegionSourceIDChanging(value);
					this.SendPropertyChanging();
					this._RegionSourceID = value;
					this.SendPropertyChanged("RegionSourceID");
					this.OnRegionSourceIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ShortName", DbType="VarChar(50) NOT NULL", CanBeNull=false)]
		public string ShortName
		{
			get
			{
				return this._ShortName;
			}
			set
			{
				if ((this._ShortName != value))
				{
					this.OnShortNameChanging(value);
					this.SendPropertyChanging();
					this._ShortName = value;
					this.SendPropertyChanged("ShortName");
					this.OnShortNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="VarChar(255) NOT NULL", CanBeNull=false)]
		public string Name
		{
			get
			{
				return this._Name;
			}
			set
			{
				if ((this._Name != value))
				{
					this.OnNameChanging(value);
					this.SendPropertyChanging();
					this._Name = value;
					this.SendPropertyChanged("Name");
					this.OnNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="RegionSource_Region_RegionSource", Storage="_Region_RegionSources", ThisKey="RegionSourceID", OtherKey="RegionSourceID")]
		public EntitySet<Region_RegionSource> Region_RegionSources
		{
			get
			{
				return this._Region_RegionSources;
			}
			set
			{
				this._Region_RegionSources.Assign(value);
			}
		}
		
		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));
			}
		}
		
		private void attach_Region_RegionSources(Region_RegionSource entity)
		{
			this.SendPropertyChanging();
			entity.RegionSource = this;
		}
		
		private void detach_Region_RegionSources(Region_RegionSource entity)
		{
			this.SendPropertyChanging();
			entity.RegionSource = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.RegionType")]
	public partial class RegionType : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _RegionTypeID;
		
		private int _RegionTypeCategoryID;
		
		private string _Name;
		
		private int _PeriodStart;
		
		private int _PeriodEnd;
		
		private EntitySet<Region> _Regions;
		
		private EntityRef<RegionTypeCategory> _RegionTypeCategory;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnRegionTypeIDChanging(int value);
    partial void OnRegionTypeIDChanged();
    partial void OnRegionTypeCategoryIDChanging(int value);
    partial void OnRegionTypeCategoryIDChanged();
    partial void OnNameChanging(string value);
    partial void OnNameChanged();
    partial void OnPeriodStartChanging(int value);
    partial void OnPeriodStartChanged();
    partial void OnPeriodEndChanging(int value);
    partial void OnPeriodEndChanged();
    #endregion
		
		public RegionType()
		{
			this._Regions = new EntitySet<Region>(new Action<Region>(this.attach_Regions), new Action<Region>(this.detach_Regions));
			this._RegionTypeCategory = default(EntityRef<RegionTypeCategory>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RegionTypeID", DbType="Int NOT NULL", IsPrimaryKey=true)]
		public int RegionTypeID
		{
			get
			{
				return this._RegionTypeID;
			}
			set
			{
				if ((this._RegionTypeID != value))
				{
					this.OnRegionTypeIDChanging(value);
					this.SendPropertyChanging();
					this._RegionTypeID = value;
					this.SendPropertyChanged("RegionTypeID");
					this.OnRegionTypeIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RegionTypeCategoryID", DbType="Int NOT NULL")]
		public int RegionTypeCategoryID
		{
			get
			{
				return this._RegionTypeCategoryID;
			}
			set
			{
				if ((this._RegionTypeCategoryID != value))
				{
					if (this._RegionTypeCategory.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnRegionTypeCategoryIDChanging(value);
					this.SendPropertyChanging();
					this._RegionTypeCategoryID = value;
					this.SendPropertyChanged("RegionTypeCategoryID");
					this.OnRegionTypeCategoryIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="VarChar(100) NOT NULL", CanBeNull=false)]
		public string Name
		{
			get
			{
				return this._Name;
			}
			set
			{
				if ((this._Name != value))
				{
					this.OnNameChanging(value);
					this.SendPropertyChanging();
					this._Name = value;
					this.SendPropertyChanged("Name");
					this.OnNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PeriodStart", DbType="Int NOT NULL")]
		public int PeriodStart
		{
			get
			{
				return this._PeriodStart;
			}
			set
			{
				if ((this._PeriodStart != value))
				{
					this.OnPeriodStartChanging(value);
					this.SendPropertyChanging();
					this._PeriodStart = value;
					this.SendPropertyChanged("PeriodStart");
					this.OnPeriodStartChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PeriodEnd", DbType="Int NOT NULL")]
		public int PeriodEnd
		{
			get
			{
				return this._PeriodEnd;
			}
			set
			{
				if ((this._PeriodEnd != value))
				{
					this.OnPeriodEndChanging(value);
					this.SendPropertyChanging();
					this._PeriodEnd = value;
					this.SendPropertyChanged("PeriodEnd");
					this.OnPeriodEndChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="RegionType_Region", Storage="_Regions", ThisKey="RegionTypeID", OtherKey="RegionTypeID")]
		public EntitySet<Region> Regions
		{
			get
			{
				return this._Regions;
			}
			set
			{
				this._Regions.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="RegionTypeCategory_RegionType", Storage="_RegionTypeCategory", ThisKey="RegionTypeCategoryID", OtherKey="RegionTypeCategoryID", IsForeignKey=true)]
		public RegionTypeCategory RegionTypeCategory
		{
			get
			{
				return this._RegionTypeCategory.Entity;
			}
			set
			{
				RegionTypeCategory previousValue = this._RegionTypeCategory.Entity;
				if (((previousValue != value) 
							|| (this._RegionTypeCategory.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._RegionTypeCategory.Entity = null;
						previousValue.RegionTypes.Remove(this);
					}
					this._RegionTypeCategory.Entity = value;
					if ((value != null))
					{
						value.RegionTypes.Add(this);
						this._RegionTypeCategoryID = value.RegionTypeCategoryID;
					}
					else
					{
						this._RegionTypeCategoryID = default(int);
					}
					this.SendPropertyChanged("RegionTypeCategory");
				}
			}
		}
		
		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));
			}
		}
		
		private void attach_Regions(Region entity)
		{
			this.SendPropertyChanging();
			entity.RegionType = this;
		}
		
		private void detach_Regions(Region entity)
		{
			this.SendPropertyChanging();
			entity.RegionType = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.RegionTypeCategory")]
	public partial class RegionTypeCategory : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _RegionTypeCategoryID;
		
		private System.Nullable<int> _ParentID;
		
		private string _Name;
		
		private EntitySet<RegionType> _RegionTypes;
		
		private EntitySet<RegionTypeCategory> _RegionTypeCategories;
		
		private EntityRef<RegionTypeCategory> _RegionTypeCategory1;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnRegionTypeCategoryIDChanging(int value);
    partial void OnRegionTypeCategoryIDChanged();
    partial void OnParentIDChanging(System.Nullable<int> value);
    partial void OnParentIDChanged();
    partial void OnNameChanging(string value);
    partial void OnNameChanged();
    #endregion
		
		public RegionTypeCategory()
		{
			this._RegionTypes = new EntitySet<RegionType>(new Action<RegionType>(this.attach_RegionTypes), new Action<RegionType>(this.detach_RegionTypes));
			this._RegionTypeCategories = new EntitySet<RegionTypeCategory>(new Action<RegionTypeCategory>(this.attach_RegionTypeCategories), new Action<RegionTypeCategory>(this.detach_RegionTypeCategories));
			this._RegionTypeCategory1 = default(EntityRef<RegionTypeCategory>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RegionTypeCategoryID", DbType="Int NOT NULL", IsPrimaryKey=true)]
		public int RegionTypeCategoryID
		{
			get
			{
				return this._RegionTypeCategoryID;
			}
			set
			{
				if ((this._RegionTypeCategoryID != value))
				{
					this.OnRegionTypeCategoryIDChanging(value);
					this.SendPropertyChanging();
					this._RegionTypeCategoryID = value;
					this.SendPropertyChanged("RegionTypeCategoryID");
					this.OnRegionTypeCategoryIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ParentID", DbType="Int")]
		public System.Nullable<int> ParentID
		{
			get
			{
				return this._ParentID;
			}
			set
			{
				if ((this._ParentID != value))
				{
					if (this._RegionTypeCategory1.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnParentIDChanging(value);
					this.SendPropertyChanging();
					this._ParentID = value;
					this.SendPropertyChanged("ParentID");
					this.OnParentIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="VarChar(50) NOT NULL", CanBeNull=false)]
		public string Name
		{
			get
			{
				return this._Name;
			}
			set
			{
				if ((this._Name != value))
				{
					this.OnNameChanging(value);
					this.SendPropertyChanging();
					this._Name = value;
					this.SendPropertyChanged("Name");
					this.OnNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="RegionTypeCategory_RegionType", Storage="_RegionTypes", ThisKey="RegionTypeCategoryID", OtherKey="RegionTypeCategoryID")]
		public EntitySet<RegionType> RegionTypes
		{
			get
			{
				return this._RegionTypes;
			}
			set
			{
				this._RegionTypes.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="RegionTypeCategory_RegionTypeCategory", Storage="_RegionTypeCategories", ThisKey="RegionTypeCategoryID", OtherKey="ParentID")]
		public EntitySet<RegionTypeCategory> RegionTypeCategories
		{
			get
			{
				return this._RegionTypeCategories;
			}
			set
			{
				this._RegionTypeCategories.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="RegionTypeCategory_RegionTypeCategory", Storage="_RegionTypeCategory1", ThisKey="ParentID", OtherKey="RegionTypeCategoryID", IsForeignKey=true)]
		public RegionTypeCategory RegionTypeCategory1
		{
			get
			{
				return this._RegionTypeCategory1.Entity;
			}
			set
			{
				RegionTypeCategory previousValue = this._RegionTypeCategory1.Entity;
				if (((previousValue != value) 
							|| (this._RegionTypeCategory1.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._RegionTypeCategory1.Entity = null;
						previousValue.RegionTypeCategories.Remove(this);
					}
					this._RegionTypeCategory1.Entity = value;
					if ((value != null))
					{
						value.RegionTypeCategories.Add(this);
						this._ParentID = value.RegionTypeCategoryID;
					}
					else
					{
						this._ParentID = default(Nullable<int>);
					}
					this.SendPropertyChanged("RegionTypeCategory1");
				}
			}
		}
		
		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));
			}
		}
		
		private void attach_RegionTypes(RegionType entity)
		{
			this.SendPropertyChanging();
			entity.RegionTypeCategory = this;
		}
		
		private void detach_RegionTypes(RegionType entity)
		{
			this.SendPropertyChanging();
			entity.RegionTypeCategory = null;
		}
		
		private void attach_RegionTypeCategories(RegionTypeCategory entity)
		{
			this.SendPropertyChanging();
			entity.RegionTypeCategory1 = this;
		}
		
		private void detach_RegionTypeCategories(RegionTypeCategory entity)
		{
			this.SendPropertyChanging();
			entity.RegionTypeCategory1 = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Role")]
	public partial class Role : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private byte _ID;
		
		private string _Code;
		
		private string _Name;
		
		private string _Description;
		
		private EntitySet<User> _Users;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnIDChanging(byte value);
    partial void OnIDChanged();
    partial void OnCodeChanging(string value);
    partial void OnCodeChanged();
    partial void OnNameChanging(string value);
    partial void OnNameChanged();
    partial void OnDescriptionChanging(string value);
    partial void OnDescriptionChanged();
    #endregion
		
		public Role()
		{
			this._Users = new EntitySet<User>(new Action<User>(this.attach_Users), new Action<User>(this.detach_Users));
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ID", AutoSync=AutoSync.OnInsert, DbType="TinyInt NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public byte ID
		{
			get
			{
				return this._ID;
			}
			set
			{
				if ((this._ID != value))
				{
					this.OnIDChanging(value);
					this.SendPropertyChanging();
					this._ID = value;
					this.SendPropertyChanged("ID");
					this.OnIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Code", DbType="NChar(10) NOT NULL", CanBeNull=false)]
		public string Code
		{
			get
			{
				return this._Code;
			}
			set
			{
				if ((this._Code != value))
				{
					this.OnCodeChanging(value);
					this.SendPropertyChanging();
					this._Code = value;
					this.SendPropertyChanged("Code");
					this.OnCodeChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
		public string Name
		{
			get
			{
				return this._Name;
			}
			set
			{
				if ((this._Name != value))
				{
					this.OnNameChanging(value);
					this.SendPropertyChanging();
					this._Name = value;
					this.SendPropertyChanged("Name");
					this.OnNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Description", DbType="Text", UpdateCheck=UpdateCheck.Never)]
		public string Description
		{
			get
			{
				return this._Description;
			}
			set
			{
				if ((this._Description != value))
				{
					this.OnDescriptionChanging(value);
					this.SendPropertyChanging();
					this._Description = value;
					this.SendPropertyChanged("Description");
					this.OnDescriptionChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Role_User", Storage="_Users", ThisKey="ID", OtherKey="RoleID")]
		public EntitySet<User> Users
		{
			get
			{
				return this._Users;
			}
			set
			{
				this._Users.Assign(value);
			}
		}
		
		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));
			}
		}
		
		private void attach_Users(User entity)
		{
			this.SendPropertyChanging();
			entity.Role = this;
		}
		
		private void detach_Users(User entity)
		{
			this.SendPropertyChanging();
			entity.Role = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Session")]
	public partial class Session : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _ID;
		
		private string _SessionID;
		
		private System.DateTime _DateCreated;
		
		private int _UserID;
		
		private string _Meta;
		
		private EntityRef<User> _User;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnIDChanging(int value);
    partial void OnIDChanged();
    partial void OnSessionIDChanging(string value);
    partial void OnSessionIDChanged();
    partial void OnDateCreatedChanging(System.DateTime value);
    partial void OnDateCreatedChanged();
    partial void OnUserIDChanging(int value);
    partial void OnUserIDChanged();
    partial void OnMetaChanging(string value);
    partial void OnMetaChanged();
    #endregion
		
		public Session()
		{
			this._User = default(EntityRef<User>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int ID
		{
			get
			{
				return this._ID;
			}
			set
			{
				if ((this._ID != value))
				{
					this.OnIDChanging(value);
					this.SendPropertyChanging();
					this._ID = value;
					this.SendPropertyChanged("ID");
					this.OnIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SessionID", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
		public string SessionID
		{
			get
			{
				return this._SessionID;
			}
			set
			{
				if ((this._SessionID != value))
				{
					this.OnSessionIDChanging(value);
					this.SendPropertyChanging();
					this._SessionID = value;
					this.SendPropertyChanged("SessionID");
					this.OnSessionIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateCreated", DbType="DateTime NOT NULL")]
		public System.DateTime DateCreated
		{
			get
			{
				return this._DateCreated;
			}
			set
			{
				if ((this._DateCreated != value))
				{
					this.OnDateCreatedChanging(value);
					this.SendPropertyChanging();
					this._DateCreated = value;
					this.SendPropertyChanged("DateCreated");
					this.OnDateCreatedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserID", DbType="Int NOT NULL")]
		public int UserID
		{
			get
			{
				return this._UserID;
			}
			set
			{
				if ((this._UserID != value))
				{
					if (this._User.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnUserIDChanging(value);
					this.SendPropertyChanging();
					this._UserID = value;
					this.SendPropertyChanged("UserID");
					this.OnUserIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Meta", DbType="Text", UpdateCheck=UpdateCheck.Never)]
		public string Meta
		{
			get
			{
				return this._Meta;
			}
			set
			{
				if ((this._Meta != value))
				{
					this.OnMetaChanging(value);
					this.SendPropertyChanging();
					this._Meta = value;
					this.SendPropertyChanged("Meta");
					this.OnMetaChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_Session", Storage="_User", ThisKey="UserID", OtherKey="UserID", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]
		public User User
		{
			get
			{
				return this._User.Entity;
			}
			set
			{
				User previousValue = this._User.Entity;
				if (((previousValue != value) 
							|| (this._User.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._User.Entity = null;
						previousValue.Sessions.Remove(this);
					}
					this._User.Entity = value;
					if ((value != null))
					{
						value.Sessions.Add(this);
						this._UserID = value.UserID;
					}
					else
					{
						this._UserID = default(int);
					}
					this.SendPropertyChanged("User");
				}
			}
		}
		
		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));
			}
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.SocialProfile")]
	public partial class SocialProfile : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _ID;
		
		private int _UserID;
		
		private string _OAuthKey;
		
		private string _OAuthProvider;
		
		private string _OAuthToken;
		
		private System.DateTime _Created;
		
		private System.Nullable<System.DateTime> _Deleted;
		
		private EntityRef<User> _User;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnIDChanging(int value);
    partial void OnIDChanged();
    partial void OnUserIDChanging(int value);
    partial void OnUserIDChanged();
    partial void OnOAuthKeyChanging(string value);
    partial void OnOAuthKeyChanged();
    partial void OnOAuthProviderChanging(string value);
    partial void OnOAuthProviderChanged();
    partial void OnOAuthTokenChanging(string value);
    partial void OnOAuthTokenChanged();
    partial void OnCreatedChanging(System.DateTime value);
    partial void OnCreatedChanged();
    partial void OnDeletedChanging(System.Nullable<System.DateTime> value);
    partial void OnDeletedChanged();
    #endregion
		
		public SocialProfile()
		{
			this._User = default(EntityRef<User>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int ID
		{
			get
			{
				return this._ID;
			}
			set
			{
				if ((this._ID != value))
				{
					this.OnIDChanging(value);
					this.SendPropertyChanging();
					this._ID = value;
					this.SendPropertyChanged("ID");
					this.OnIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserID", DbType="Int NOT NULL")]
		public int UserID
		{
			get
			{
				return this._UserID;
			}
			set
			{
				if ((this._UserID != value))
				{
					if (this._User.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnUserIDChanging(value);
					this.SendPropertyChanging();
					this._UserID = value;
					this.SendPropertyChanged("UserID");
					this.OnUserIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OAuthKey", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
		public string OAuthKey
		{
			get
			{
				return this._OAuthKey;
			}
			set
			{
				if ((this._OAuthKey != value))
				{
					this.OnOAuthKeyChanging(value);
					this.SendPropertyChanging();
					this._OAuthKey = value;
					this.SendPropertyChanged("OAuthKey");
					this.OnOAuthKeyChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OAuthProvider", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
		public string OAuthProvider
		{
			get
			{
				return this._OAuthProvider;
			}
			set
			{
				if ((this._OAuthProvider != value))
				{
					this.OnOAuthProviderChanging(value);
					this.SendPropertyChanging();
					this._OAuthProvider = value;
					this.SendPropertyChanged("OAuthProvider");
					this.OnOAuthProviderChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OAuthToken", DbType="Text", UpdateCheck=UpdateCheck.Never)]
		public string OAuthToken
		{
			get
			{
				return this._OAuthToken;
			}
			set
			{
				if ((this._OAuthToken != value))
				{
					this.OnOAuthTokenChanging(value);
					this.SendPropertyChanging();
					this._OAuthToken = value;
					this.SendPropertyChanged("OAuthToken");
					this.OnOAuthTokenChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Created", DbType="DateTime NOT NULL")]
		public System.DateTime Created
		{
			get
			{
				return this._Created;
			}
			set
			{
				if ((this._Created != value))
				{
					this.OnCreatedChanging(value);
					this.SendPropertyChanging();
					this._Created = value;
					this.SendPropertyChanged("Created");
					this.OnCreatedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Deleted", DbType="DateTime")]
		public System.Nullable<System.DateTime> Deleted
		{
			get
			{
				return this._Deleted;
			}
			set
			{
				if ((this._Deleted != value))
				{
					this.OnDeletedChanging(value);
					this.SendPropertyChanging();
					this._Deleted = value;
					this.SendPropertyChanged("Deleted");
					this.OnDeletedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_SocialProfile", Storage="_User", ThisKey="UserID", OtherKey="UserID", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]
		public User User
		{
			get
			{
				return this._User.Entity;
			}
			set
			{
				User previousValue = this._User.Entity;
				if (((previousValue != value) 
							|| (this._User.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._User.Entity = null;
						previousValue.SocialProfiles.Remove(this);
					}
					this._User.Entity = value;
					if ((value != null))
					{
						value.SocialProfiles.Add(this);
						this._UserID = value.UserID;
					}
					else
					{
						this._UserID = default(int);
					}
					this.SendPropertyChanged("User");
				}
			}
		}
		
		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));
			}
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Tag_Content")]
	public partial class Tag_Content : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _TagID;
		
		private int _ContentID;
		
		private EntityRef<Tag> _Tag;
		
		private EntityRef<Content> _Content;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnTagIDChanging(int value);
    partial void OnTagIDChanged();
    partial void OnContentIDChanging(int value);
    partial void OnContentIDChanged();
    #endregion
		
		public Tag_Content()
		{
			this._Tag = default(EntityRef<Tag>);
			this._Content = default(EntityRef<Content>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TagID", DbType="Int NOT NULL", IsPrimaryKey=true)]
		public int TagID
		{
			get
			{
				return this._TagID;
			}
			set
			{
				if ((this._TagID != value))
				{
					if (this._Tag.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnTagIDChanging(value);
					this.SendPropertyChanging();
					this._TagID = value;
					this.SendPropertyChanged("TagID");
					this.OnTagIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContentID", DbType="Int NOT NULL", IsPrimaryKey=true)]
		public int ContentID
		{
			get
			{
				return this._ContentID;
			}
			set
			{
				if ((this._ContentID != value))
				{
					if (this._Content.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnContentIDChanging(value);
					this.SendPropertyChanging();
					this._ContentID = value;
					this.SendPropertyChanged("ContentID");
					this.OnContentIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Tag_Tag_Content", Storage="_Tag", ThisKey="TagID", OtherKey="TagID", IsForeignKey=true)]
		public Tag Tag
		{
			get
			{
				return this._Tag.Entity;
			}
			set
			{
				Tag previousValue = this._Tag.Entity;
				if (((previousValue != value) 
							|| (this._Tag.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Tag.Entity = null;
						previousValue.Tag_Contents.Remove(this);
					}
					this._Tag.Entity = value;
					if ((value != null))
					{
						value.Tag_Contents.Add(this);
						this._TagID = value.TagID;
					}
					else
					{
						this._TagID = default(int);
					}
					this.SendPropertyChanged("Tag");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Content_Tag_Content", Storage="_Content", ThisKey="ContentID", OtherKey="ContentID", IsForeignKey=true)]
		public Content Content
		{
			get
			{
				return this._Content.Entity;
			}
			set
			{
				Content previousValue = this._Content.Entity;
				if (((previousValue != value) 
							|| (this._Content.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Content.Entity = null;
						previousValue.Tag_Contents.Remove(this);
					}
					this._Content.Entity = value;
					if ((value != null))
					{
						value.Tag_Contents.Add(this);
						this._ContentID = value.ContentID;
					}
					else
					{
						this._ContentID = default(int);
					}
					this.SendPropertyChanged("Content");
				}
			}
		}
		
		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));
			}
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Tag_Geo")]
	public partial class Tag_Geo : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _TagID;
		
		private int _GeoID;
		
		private System.Nullable<int> _YearStart;
		
		private System.Nullable<int> _YearEnd;
		
		private int _UserID;
		
		private System.Nullable<System.DateTime> _Deleted;
		
		private System.DateTime _Created;
		
		private EntityRef<Tag> _Tag;
		
		private EntityRef<Geo> _Geo;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnTagIDChanging(int value);
    partial void OnTagIDChanged();
    partial void OnGeoIDChanging(int value);
    partial void OnGeoIDChanged();
    partial void OnYearStartChanging(System.Nullable<int> value);
    partial void OnYearStartChanged();
    partial void OnYearEndChanging(System.Nullable<int> value);
    partial void OnYearEndChanged();
    partial void OnUserIDChanging(int value);
    partial void OnUserIDChanged();
    partial void OnDeletedChanging(System.Nullable<System.DateTime> value);
    partial void OnDeletedChanged();
    partial void OnCreatedChanging(System.DateTime value);
    partial void OnCreatedChanged();
    #endregion
		
		public Tag_Geo()
		{
			this._Tag = default(EntityRef<Tag>);
			this._Geo = default(EntityRef<Geo>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TagID", DbType="Int NOT NULL", IsPrimaryKey=true)]
		public int TagID
		{
			get
			{
				return this._TagID;
			}
			set
			{
				if ((this._TagID != value))
				{
					if (this._Tag.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnTagIDChanging(value);
					this.SendPropertyChanging();
					this._TagID = value;
					this.SendPropertyChanged("TagID");
					this.OnTagIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GeoID", DbType="Int NOT NULL", IsPrimaryKey=true)]
		public int GeoID
		{
			get
			{
				return this._GeoID;
			}
			set
			{
				if ((this._GeoID != value))
				{
					if (this._Geo.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnGeoIDChanging(value);
					this.SendPropertyChanging();
					this._GeoID = value;
					this.SendPropertyChanged("GeoID");
					this.OnGeoIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_YearStart", DbType="Int")]
		public System.Nullable<int> YearStart
		{
			get
			{
				return this._YearStart;
			}
			set
			{
				if ((this._YearStart != value))
				{
					this.OnYearStartChanging(value);
					this.SendPropertyChanging();
					this._YearStart = value;
					this.SendPropertyChanged("YearStart");
					this.OnYearStartChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_YearEnd", DbType="Int")]
		public System.Nullable<int> YearEnd
		{
			get
			{
				return this._YearEnd;
			}
			set
			{
				if ((this._YearEnd != value))
				{
					this.OnYearEndChanging(value);
					this.SendPropertyChanging();
					this._YearEnd = value;
					this.SendPropertyChanged("YearEnd");
					this.OnYearEndChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserID", DbType="Int NOT NULL")]
		public int UserID
		{
			get
			{
				return this._UserID;
			}
			set
			{
				if ((this._UserID != value))
				{
					this.OnUserIDChanging(value);
					this.SendPropertyChanging();
					this._UserID = value;
					this.SendPropertyChanged("UserID");
					this.OnUserIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Deleted", DbType="DateTime")]
		public System.Nullable<System.DateTime> Deleted
		{
			get
			{
				return this._Deleted;
			}
			set
			{
				if ((this._Deleted != value))
				{
					this.OnDeletedChanging(value);
					this.SendPropertyChanging();
					this._Deleted = value;
					this.SendPropertyChanged("Deleted");
					this.OnDeletedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Created", DbType="DateTime NOT NULL")]
		public System.DateTime Created
		{
			get
			{
				return this._Created;
			}
			set
			{
				if ((this._Created != value))
				{
					this.OnCreatedChanging(value);
					this.SendPropertyChanging();
					this._Created = value;
					this.SendPropertyChanged("Created");
					this.OnCreatedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Tag_Tag_Geo", Storage="_Tag", ThisKey="TagID", OtherKey="TagID", IsForeignKey=true)]
		public Tag Tag
		{
			get
			{
				return this._Tag.Entity;
			}
			set
			{
				Tag previousValue = this._Tag.Entity;
				if (((previousValue != value) 
							|| (this._Tag.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Tag.Entity = null;
						previousValue.Tag_Geos.Remove(this);
					}
					this._Tag.Entity = value;
					if ((value != null))
					{
						value.Tag_Geos.Add(this);
						this._TagID = value.TagID;
					}
					else
					{
						this._TagID = default(int);
					}
					this.SendPropertyChanged("Tag");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Geo_Tag_Geo", Storage="_Geo", ThisKey="GeoID", OtherKey="GeoID", IsForeignKey=true)]
		public Geo Geo
		{
			get
			{
				return this._Geo.Entity;
			}
			set
			{
				Geo previousValue = this._Geo.Entity;
				if (((previousValue != value) 
							|| (this._Geo.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Geo.Entity = null;
						previousValue.Tag_Geos.Remove(this);
					}
					this._Geo.Entity = value;
					if ((value != null))
					{
						value.Tag_Geos.Add(this);
						this._GeoID = value.GeoID;
					}
					else
					{
						this._GeoID = default(int);
					}
					this.SendPropertyChanged("Geo");
				}
			}
		}
		
		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));
			}
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Tag_Image")]
	public partial class Tag_Image : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _TagID;
		
		private int _ImageID;
		
		private System.Nullable<System.DateTime> _Deleted;
		
		private System.DateTime _Created;
		
		private EntityRef<Image> _Image;
		
		private EntityRef<Tag> _Tag;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnTagIDChanging(int value);
    partial void OnTagIDChanged();
    partial void OnImageIDChanging(int value);
    partial void OnImageIDChanged();
    partial void OnDeletedChanging(System.Nullable<System.DateTime> value);
    partial void OnDeletedChanged();
    partial void OnCreatedChanging(System.DateTime value);
    partial void OnCreatedChanged();
    #endregion
		
		public Tag_Image()
		{
			this._Image = default(EntityRef<Image>);
			this._Tag = default(EntityRef<Tag>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TagID", DbType="Int NOT NULL", IsPrimaryKey=true)]
		public int TagID
		{
			get
			{
				return this._TagID;
			}
			set
			{
				if ((this._TagID != value))
				{
					if (this._Tag.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnTagIDChanging(value);
					this.SendPropertyChanging();
					this._TagID = value;
					this.SendPropertyChanged("TagID");
					this.OnTagIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ImageID", DbType="Int NOT NULL", IsPrimaryKey=true)]
		public int ImageID
		{
			get
			{
				return this._ImageID;
			}
			set
			{
				if ((this._ImageID != value))
				{
					if (this._Image.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnImageIDChanging(value);
					this.SendPropertyChanging();
					this._ImageID = value;
					this.SendPropertyChanged("ImageID");
					this.OnImageIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Deleted", DbType="DateTime")]
		public System.Nullable<System.DateTime> Deleted
		{
			get
			{
				return this._Deleted;
			}
			set
			{
				if ((this._Deleted != value))
				{
					this.OnDeletedChanging(value);
					this.SendPropertyChanging();
					this._Deleted = value;
					this.SendPropertyChanged("Deleted");
					this.OnDeletedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Created", DbType="DateTime NOT NULL")]
		public System.DateTime Created
		{
			get
			{
				return this._Created;
			}
			set
			{
				if ((this._Created != value))
				{
					this.OnCreatedChanging(value);
					this.SendPropertyChanging();
					this._Created = value;
					this.SendPropertyChanged("Created");
					this.OnCreatedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Image_Tag_Image", Storage="_Image", ThisKey="ImageID", OtherKey="ImageID", IsForeignKey=true)]
		public Image Image
		{
			get
			{
				return this._Image.Entity;
			}
			set
			{
				Image previousValue = this._Image.Entity;
				if (((previousValue != value) 
							|| (this._Image.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Image.Entity = null;
						previousValue.Tag_Images.Remove(this);
					}
					this._Image.Entity = value;
					if ((value != null))
					{
						value.Tag_Images.Add(this);
						this._ImageID = value.ImageID;
					}
					else
					{
						this._ImageID = default(int);
					}
					this.SendPropertyChanged("Image");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Tag_Tag_Image", Storage="_Tag", ThisKey="TagID", OtherKey="TagID", IsForeignKey=true)]
		public Tag Tag
		{
			get
			{
				return this._Tag.Entity;
			}
			set
			{
				Tag previousValue = this._Tag.Entity;
				if (((previousValue != value) 
							|| (this._Tag.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Tag.Entity = null;
						previousValue.Tag_Images.Remove(this);
					}
					this._Tag.Entity = value;
					if ((value != null))
					{
						value.Tag_Images.Add(this);
						this._TagID = value.TagID;
					}
					else
					{
						this._TagID = default(int);
					}
					this.SendPropertyChanged("Tag");
				}
			}
		}
		
		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));
			}
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.TagHierarki")]
	public partial class TagHierarki : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _UpperTagID;
		
		private int _TagID;
		
		private EntityRef<Tag> _Tag;
		
		private EntityRef<Tag> _Tag1;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnUpperTagIDChanging(int value);
    partial void OnUpperTagIDChanged();
    partial void OnTagIDChanging(int value);
    partial void OnTagIDChanged();
    #endregion
		
		public TagHierarki()
		{
			this._Tag = default(EntityRef<Tag>);
			this._Tag1 = default(EntityRef<Tag>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UpperTagID", DbType="Int NOT NULL", IsPrimaryKey=true)]
		public int UpperTagID
		{
			get
			{
				return this._UpperTagID;
			}
			set
			{
				if ((this._UpperTagID != value))
				{
					if (this._Tag.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnUpperTagIDChanging(value);
					this.SendPropertyChanging();
					this._UpperTagID = value;
					this.SendPropertyChanged("UpperTagID");
					this.OnUpperTagIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TagID", DbType="Int NOT NULL", IsPrimaryKey=true)]
		public int TagID
		{
			get
			{
				return this._TagID;
			}
			set
			{
				if ((this._TagID != value))
				{
					if (this._Tag1.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnTagIDChanging(value);
					this.SendPropertyChanging();
					this._TagID = value;
					this.SendPropertyChanged("TagID");
					this.OnTagIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Tag_TagHierarki", Storage="_Tag", ThisKey="UpperTagID", OtherKey="TagID", IsForeignKey=true)]
		public Tag Tag
		{
			get
			{
				return this._Tag.Entity;
			}
			set
			{
				Tag previousValue = this._Tag.Entity;
				if (((previousValue != value) 
							|| (this._Tag.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Tag.Entity = null;
						previousValue.TagHierarkis.Remove(this);
					}
					this._Tag.Entity = value;
					if ((value != null))
					{
						value.TagHierarkis.Add(this);
						this._UpperTagID = value.TagID;
					}
					else
					{
						this._UpperTagID = default(int);
					}
					this.SendPropertyChanged("Tag");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Tag_TagHierarki1", Storage="_Tag1", ThisKey="TagID", OtherKey="TagID", IsForeignKey=true)]
		public Tag Tag1
		{
			get
			{
				return this._Tag1.Entity;
			}
			set
			{
				Tag previousValue = this._Tag1.Entity;
				if (((previousValue != value) 
							|| (this._Tag1.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Tag1.Entity = null;
						previousValue.TagHierarkis1.Remove(this);
					}
					this._Tag1.Entity = value;
					if ((value != null))
					{
						value.TagHierarkis1.Add(this);
						this._TagID = value.TagID;
					}
					else
					{
						this._TagID = default(int);
					}
					this.SendPropertyChanged("Tag1");
				}
			}
		}
		
		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));
			}
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.[User]")]
	public partial class User : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _UserID;
		
		private string _Login;
		
		private string _Password;
		
		private string _FirstName;
		
		private string _LastName;
		
		private string _Email;
		
		private string _Location;
		
		private string _About;
		
		private string _InternalNote;
		
		private System.DateTime _Created;
		
		private System.Nullable<System.DateTime> _Deleted;
		
		private System.Nullable<int> _DefaultLicenseID;
		
		private string _LicenseName;
		
		private string _DefaultURLParameters;
		
		private System.Nullable<int> _GeoID;
		
		private byte _RoleID;
		
		private System.DateTime _PasswordValidTo;
		
		private bool _UpdatePassRequired;
		
		private bool _IsActive;
		
		private EntitySet<UserHierarki> _UserHierarkis;
		
		private EntitySet<UserHierarki> _UserHierarkis1;
		
		private EntitySet<Error> _Errors;
		
		private EntitySet<Image> _Images;
		
		private EntitySet<Log> _Logs;
		
		private EntitySet<Session> _Sessions;
		
		private EntitySet<SocialProfile> _SocialProfiles;
		
		private EntitySet<Geo> _Geos;
		
		private EntitySet<Collection> _Collections;
		
		private EntitySet<Map> _Maps;
		
		private EntitySet<PDF> _PDFs;
		
		private EntitySet<Content> _Contents;
		
		private EntitySet<Biblio> _Biblios;
		
		private EntitySet<ExternalContent> _ExternalContents;
		
		private EntitySet<User_Institution> _User_Institutions;
		
		private EntitySet<Text> _Texts;
		
		private EntityRef<Role> _Role;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnUserIDChanging(int value);
    partial void OnUserIDChanged();
    partial void OnLoginChanging(string value);
    partial void OnLoginChanged();
    partial void OnPasswordChanging(string value);
    partial void OnPasswordChanged();
    partial void OnFirstNameChanging(string value);
    partial void OnFirstNameChanged();
    partial void OnLastNameChanging(string value);
    partial void OnLastNameChanged();
    partial void OnEmailChanging(string value);
    partial void OnEmailChanged();
    partial void OnLocationChanging(string value);
    partial void OnLocationChanged();
    partial void OnAboutChanging(string value);
    partial void OnAboutChanged();
    partial void OnInternalNoteChanging(string value);
    partial void OnInternalNoteChanged();
    partial void OnCreatedChanging(System.DateTime value);
    partial void OnCreatedChanged();
    partial void OnDeletedChanging(System.Nullable<System.DateTime> value);
    partial void OnDeletedChanged();
    partial void OnDefaultLicenseIDChanging(System.Nullable<int> value);
    partial void OnDefaultLicenseIDChanged();
    partial void OnLicenseNameChanging(string value);
    partial void OnLicenseNameChanged();
    partial void OnDefaultURLParametersChanging(string value);
    partial void OnDefaultURLParametersChanged();
    partial void OnGeoIDChanging(System.Nullable<int> value);
    partial void OnGeoIDChanged();
    partial void OnRoleIDChanging(byte value);
    partial void OnRoleIDChanged();
    partial void OnPasswordValidToChanging(System.DateTime value);
    partial void OnPasswordValidToChanged();
    partial void OnUpdatePassRequiredChanging(bool value);
    partial void OnUpdatePassRequiredChanged();
    partial void OnIsActiveChanging(bool value);
    partial void OnIsActiveChanged();
    #endregion
		
		public User()
		{
			this._UserHierarkis = new EntitySet<UserHierarki>(new Action<UserHierarki>(this.attach_UserHierarkis), new Action<UserHierarki>(this.detach_UserHierarkis));
			this._UserHierarkis1 = new EntitySet<UserHierarki>(new Action<UserHierarki>(this.attach_UserHierarkis1), new Action<UserHierarki>(this.detach_UserHierarkis1));
			this._Errors = new EntitySet<Error>(new Action<Error>(this.attach_Errors), new Action<Error>(this.detach_Errors));
			this._Images = new EntitySet<Image>(new Action<Image>(this.attach_Images), new Action<Image>(this.detach_Images));
			this._Logs = new EntitySet<Log>(new Action<Log>(this.attach_Logs), new Action<Log>(this.detach_Logs));
			this._Sessions = new EntitySet<Session>(new Action<Session>(this.attach_Sessions), new Action<Session>(this.detach_Sessions));
			this._SocialProfiles = new EntitySet<SocialProfile>(new Action<SocialProfile>(this.attach_SocialProfiles), new Action<SocialProfile>(this.detach_SocialProfiles));
			this._Geos = new EntitySet<Geo>(new Action<Geo>(this.attach_Geos), new Action<Geo>(this.detach_Geos));
			this._Collections = new EntitySet<Collection>(new Action<Collection>(this.attach_Collections), new Action<Collection>(this.detach_Collections));
			this._Maps = new EntitySet<Map>(new Action<Map>(this.attach_Maps), new Action<Map>(this.detach_Maps));
			this._PDFs = new EntitySet<PDF>(new Action<PDF>(this.attach_PDFs), new Action<PDF>(this.detach_PDFs));
			this._Contents = new EntitySet<Content>(new Action<Content>(this.attach_Contents), new Action<Content>(this.detach_Contents));
			this._Biblios = new EntitySet<Biblio>(new Action<Biblio>(this.attach_Biblios), new Action<Biblio>(this.detach_Biblios));
			this._ExternalContents = new EntitySet<ExternalContent>(new Action<ExternalContent>(this.attach_ExternalContents), new Action<ExternalContent>(this.detach_ExternalContents));
			this._User_Institutions = new EntitySet<User_Institution>(new Action<User_Institution>(this.attach_User_Institutions), new Action<User_Institution>(this.detach_User_Institutions));
			this._Texts = new EntitySet<Text>(new Action<Text>(this.attach_Texts), new Action<Text>(this.detach_Texts));
			this._Role = default(EntityRef<Role>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int UserID
		{
			get
			{
				return this._UserID;
			}
			set
			{
				if ((this._UserID != value))
				{
					this.OnUserIDChanging(value);
					this.SendPropertyChanging();
					this._UserID = value;
					this.SendPropertyChanged("UserID");
					this.OnUserIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Login", DbType="NVarChar(254) NOT NULL", CanBeNull=false)]
		public string Login
		{
			get
			{
				return this._Login;
			}
			set
			{
				if ((this._Login != value))
				{
					this.OnLoginChanging(value);
					this.SendPropertyChanging();
					this._Login = value;
					this.SendPropertyChanged("Login");
					this.OnLoginChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Password", DbType="NVarChar(32) NOT NULL", CanBeNull=false)]
		public string Password
		{
			get
			{
				return this._Password;
			}
			set
			{
				if ((this._Password != value))
				{
					this.OnPasswordChanging(value);
					this.SendPropertyChanging();
					this._Password = value;
					this.SendPropertyChanged("Password");
					this.OnPasswordChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FirstName", DbType="NVarChar(50)")]
		public string FirstName
		{
			get
			{
				return this._FirstName;
			}
			set
			{
				if ((this._FirstName != value))
				{
					this.OnFirstNameChanging(value);
					this.SendPropertyChanging();
					this._FirstName = value;
					this.SendPropertyChanged("FirstName");
					this.OnFirstNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LastName", DbType="NVarChar(50)")]
		public string LastName
		{
			get
			{
				return this._LastName;
			}
			set
			{
				if ((this._LastName != value))
				{
					this.OnLastNameChanging(value);
					this.SendPropertyChanging();
					this._LastName = value;
					this.SendPropertyChanged("LastName");
					this.OnLastNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Email", DbType="NVarChar(254)")]
		public string Email
		{
			get
			{
				return this._Email;
			}
			set
			{
				if ((this._Email != value))
				{
					this.OnEmailChanging(value);
					this.SendPropertyChanging();
					this._Email = value;
					this.SendPropertyChanged("Email");
					this.OnEmailChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Location", DbType="NVarChar(100)")]
		public string Location
		{
			get
			{
				return this._Location;
			}
			set
			{
				if ((this._Location != value))
				{
					this.OnLocationChanging(value);
					this.SendPropertyChanging();
					this._Location = value;
					this.SendPropertyChanged("Location");
					this.OnLocationChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_About", DbType="NVarChar(254)")]
		public string About
		{
			get
			{
				return this._About;
			}
			set
			{
				if ((this._About != value))
				{
					this.OnAboutChanging(value);
					this.SendPropertyChanging();
					this._About = value;
					this.SendPropertyChanged("About");
					this.OnAboutChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InternalNote", DbType="Text", UpdateCheck=UpdateCheck.Never)]
		public string InternalNote
		{
			get
			{
				return this._InternalNote;
			}
			set
			{
				if ((this._InternalNote != value))
				{
					this.OnInternalNoteChanging(value);
					this.SendPropertyChanging();
					this._InternalNote = value;
					this.SendPropertyChanged("InternalNote");
					this.OnInternalNoteChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Created", DbType="DateTime NOT NULL")]
		public System.DateTime Created
		{
			get
			{
				return this._Created;
			}
			set
			{
				if ((this._Created != value))
				{
					this.OnCreatedChanging(value);
					this.SendPropertyChanging();
					this._Created = value;
					this.SendPropertyChanged("Created");
					this.OnCreatedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Deleted", DbType="DateTime")]
		public System.Nullable<System.DateTime> Deleted
		{
			get
			{
				return this._Deleted;
			}
			set
			{
				if ((this._Deleted != value))
				{
					this.OnDeletedChanging(value);
					this.SendPropertyChanging();
					this._Deleted = value;
					this.SendPropertyChanged("Deleted");
					this.OnDeletedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DefaultLicenseID", DbType="Int")]
		public System.Nullable<int> DefaultLicenseID
		{
			get
			{
				return this._DefaultLicenseID;
			}
			set
			{
				if ((this._DefaultLicenseID != value))
				{
					this.OnDefaultLicenseIDChanging(value);
					this.SendPropertyChanging();
					this._DefaultLicenseID = value;
					this.SendPropertyChanged("DefaultLicenseID");
					this.OnDefaultLicenseIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LicenseName", DbType="NVarChar(50)")]
		public string LicenseName
		{
			get
			{
				return this._LicenseName;
			}
			set
			{
				if ((this._LicenseName != value))
				{
					this.OnLicenseNameChanging(value);
					this.SendPropertyChanging();
					this._LicenseName = value;
					this.SendPropertyChanged("LicenseName");
					this.OnLicenseNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DefaultURLParameters", DbType="NVarChar(254)")]
		public string DefaultURLParameters
		{
			get
			{
				return this._DefaultURLParameters;
			}
			set
			{
				if ((this._DefaultURLParameters != value))
				{
					this.OnDefaultURLParametersChanging(value);
					this.SendPropertyChanging();
					this._DefaultURLParameters = value;
					this.SendPropertyChanged("DefaultURLParameters");
					this.OnDefaultURLParametersChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GeoID", DbType="Int")]
		public System.Nullable<int> GeoID
		{
			get
			{
				return this._GeoID;
			}
			set
			{
				if ((this._GeoID != value))
				{
					this.OnGeoIDChanging(value);
					this.SendPropertyChanging();
					this._GeoID = value;
					this.SendPropertyChanged("GeoID");
					this.OnGeoIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RoleID", DbType="TinyInt NOT NULL")]
		public byte RoleID
		{
			get
			{
				return this._RoleID;
			}
			set
			{
				if ((this._RoleID != value))
				{
					if (this._Role.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnRoleIDChanging(value);
					this.SendPropertyChanging();
					this._RoleID = value;
					this.SendPropertyChanged("RoleID");
					this.OnRoleIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PasswordValidTo", DbType="DateTime NOT NULL")]
		public System.DateTime PasswordValidTo
		{
			get
			{
				return this._PasswordValidTo;
			}
			set
			{
				if ((this._PasswordValidTo != value))
				{
					this.OnPasswordValidToChanging(value);
					this.SendPropertyChanging();
					this._PasswordValidTo = value;
					this.SendPropertyChanged("PasswordValidTo");
					this.OnPasswordValidToChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UpdatePassRequired", DbType="Bit NOT NULL")]
		public bool UpdatePassRequired
		{
			get
			{
				return this._UpdatePassRequired;
			}
			set
			{
				if ((this._UpdatePassRequired != value))
				{
					this.OnUpdatePassRequiredChanging(value);
					this.SendPropertyChanging();
					this._UpdatePassRequired = value;
					this.SendPropertyChanged("UpdatePassRequired");
					this.OnUpdatePassRequiredChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsActive", DbType="Bit NOT NULL")]
		public bool IsActive
		{
			get
			{
				return this._IsActive;
			}
			set
			{
				if ((this._IsActive != value))
				{
					this.OnIsActiveChanging(value);
					this.SendPropertyChanging();
					this._IsActive = value;
					this.SendPropertyChanged("IsActive");
					this.OnIsActiveChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_UserHierarki", Storage="_UserHierarkis", ThisKey="UserID", OtherKey="UpperUserID")]
		public EntitySet<UserHierarki> UserHierarkis
		{
			get
			{
				return this._UserHierarkis;
			}
			set
			{
				this._UserHierarkis.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_UserHierarki1", Storage="_UserHierarkis1", ThisKey="UserID", OtherKey="UserID")]
		public EntitySet<UserHierarki> UserHierarkis1
		{
			get
			{
				return this._UserHierarkis1;
			}
			set
			{
				this._UserHierarkis1.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_Error", Storage="_Errors", ThisKey="UserID", OtherKey="UserID")]
		public EntitySet<Error> Errors
		{
			get
			{
				return this._Errors;
			}
			set
			{
				this._Errors.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_Image", Storage="_Images", ThisKey="UserID", OtherKey="UserID")]
		public EntitySet<Image> Images
		{
			get
			{
				return this._Images;
			}
			set
			{
				this._Images.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_Log", Storage="_Logs", ThisKey="UserID", OtherKey="UserID")]
		public EntitySet<Log> Logs
		{
			get
			{
				return this._Logs;
			}
			set
			{
				this._Logs.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_Session", Storage="_Sessions", ThisKey="UserID", OtherKey="UserID")]
		public EntitySet<Session> Sessions
		{
			get
			{
				return this._Sessions;
			}
			set
			{
				this._Sessions.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_SocialProfile", Storage="_SocialProfiles", ThisKey="UserID", OtherKey="UserID")]
		public EntitySet<SocialProfile> SocialProfiles
		{
			get
			{
				return this._SocialProfiles;
			}
			set
			{
				this._SocialProfiles.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_Geo", Storage="_Geos", ThisKey="UserID", OtherKey="UserID")]
		public EntitySet<Geo> Geos
		{
			get
			{
				return this._Geos;
			}
			set
			{
				this._Geos.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_Collection", Storage="_Collections", ThisKey="UserID", OtherKey="UserID")]
		public EntitySet<Collection> Collections
		{
			get
			{
				return this._Collections;
			}
			set
			{
				this._Collections.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_Map", Storage="_Maps", ThisKey="UserID", OtherKey="UserID")]
		public EntitySet<Map> Maps
		{
			get
			{
				return this._Maps;
			}
			set
			{
				this._Maps.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_PDF", Storage="_PDFs", ThisKey="UserID", OtherKey="UserID")]
		public EntitySet<PDF> PDFs
		{
			get
			{
				return this._PDFs;
			}
			set
			{
				this._PDFs.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_Content", Storage="_Contents", ThisKey="UserID", OtherKey="UserID")]
		public EntitySet<Content> Contents
		{
			get
			{
				return this._Contents;
			}
			set
			{
				this._Contents.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_Biblio", Storage="_Biblios", ThisKey="UserID", OtherKey="UserID")]
		public EntitySet<Biblio> Biblios
		{
			get
			{
				return this._Biblios;
			}
			set
			{
				this._Biblios.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_ExternalContent", Storage="_ExternalContents", ThisKey="UserID", OtherKey="UserID")]
		public EntitySet<ExternalContent> ExternalContents
		{
			get
			{
				return this._ExternalContents;
			}
			set
			{
				this._ExternalContents.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_User_Institution", Storage="_User_Institutions", ThisKey="UserID", OtherKey="UserID")]
		public EntitySet<User_Institution> User_Institutions
		{
			get
			{
				return this._User_Institutions;
			}
			set
			{
				this._User_Institutions.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_Text", Storage="_Texts", ThisKey="UserID", OtherKey="UserID")]
		public EntitySet<Text> Texts
		{
			get
			{
				return this._Texts;
			}
			set
			{
				this._Texts.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Role_User", Storage="_Role", ThisKey="RoleID", OtherKey="ID", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]
		public Role Role
		{
			get
			{
				return this._Role.Entity;
			}
			set
			{
				Role previousValue = this._Role.Entity;
				if (((previousValue != value) 
							|| (this._Role.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Role.Entity = null;
						previousValue.Users.Remove(this);
					}
					this._Role.Entity = value;
					if ((value != null))
					{
						value.Users.Add(this);
						this._RoleID = value.ID;
					}
					else
					{
						this._RoleID = default(byte);
					}
					this.SendPropertyChanged("Role");
				}
			}
		}
		
		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));
			}
		}
		
		private void attach_UserHierarkis(UserHierarki entity)
		{
			this.SendPropertyChanging();
			entity.User = this;
		}
		
		private void detach_UserHierarkis(UserHierarki entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
		
		private void attach_UserHierarkis1(UserHierarki entity)
		{
			this.SendPropertyChanging();
			entity.User1 = this;
		}
		
		private void detach_UserHierarkis1(UserHierarki entity)
		{
			this.SendPropertyChanging();
			entity.User1 = null;
		}
		
		private void attach_Errors(Error entity)
		{
			this.SendPropertyChanging();
			entity.User = this;
		}
		
		private void detach_Errors(Error entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
		
		private void attach_Images(Image entity)
		{
			this.SendPropertyChanging();
			entity.User = this;
		}
		
		private void detach_Images(Image entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
		
		private void attach_Logs(Log entity)
		{
			this.SendPropertyChanging();
			entity.User = this;
		}
		
		private void detach_Logs(Log entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
		
		private void attach_Sessions(Session entity)
		{
			this.SendPropertyChanging();
			entity.User = this;
		}
		
		private void detach_Sessions(Session entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
		
		private void attach_SocialProfiles(SocialProfile entity)
		{
			this.SendPropertyChanging();
			entity.User = this;
		}
		
		private void detach_SocialProfiles(SocialProfile entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
		
		private void attach_Geos(Geo entity)
		{
			this.SendPropertyChanging();
			entity.User = this;
		}
		
		private void detach_Geos(Geo entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
		
		private void attach_Collections(Collection entity)
		{
			this.SendPropertyChanging();
			entity.User = this;
		}
		
		private void detach_Collections(Collection entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
		
		private void attach_Maps(Map entity)
		{
			this.SendPropertyChanging();
			entity.User = this;
		}
		
		private void detach_Maps(Map entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
		
		private void attach_PDFs(PDF entity)
		{
			this.SendPropertyChanging();
			entity.User = this;
		}
		
		private void detach_PDFs(PDF entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
		
		private void attach_Contents(Content entity)
		{
			this.SendPropertyChanging();
			entity.User = this;
		}
		
		private void detach_Contents(Content entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
		
		private void attach_Biblios(Biblio entity)
		{
			this.SendPropertyChanging();
			entity.User = this;
		}
		
		private void detach_Biblios(Biblio entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
		
		private void attach_ExternalContents(ExternalContent entity)
		{
			this.SendPropertyChanging();
			entity.User = this;
		}
		
		private void detach_ExternalContents(ExternalContent entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
		
		private void attach_User_Institutions(User_Institution entity)
		{
			this.SendPropertyChanging();
			entity.User = this;
		}
		
		private void detach_User_Institutions(User_Institution entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
		
		private void attach_Texts(Text entity)
		{
			this.SendPropertyChanging();
			entity.User = this;
		}
		
		private void detach_Texts(Text entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Theme")]
	public partial class Theme : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private string _LinkName;
		
		private string _Name;
		
		private System.Nullable<int> _MapID;
		
		private System.Nullable<decimal> _MapLatitude;
		
		private System.Nullable<decimal> _MapLongitude;
		
		private System.Nullable<double> _MapZoom;
		
		private System.Nullable<int> _TagID;
		
		private System.Nullable<int> _ContentID;
		
		private EntityRef<Tag> _Tag;
		
		private EntityRef<Map> _Map;
		
		private EntityRef<Content> _Content;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnLinkNameChanging(string value);
    partial void OnLinkNameChanged();
    partial void OnNameChanging(string value);
    partial void OnNameChanged();
    partial void OnMapIDChanging(System.Nullable<int> value);
    partial void OnMapIDChanged();
    partial void OnMapLatitudeChanging(System.Nullable<decimal> value);
    partial void OnMapLatitudeChanged();
    partial void OnMapLongitudeChanging(System.Nullable<decimal> value);
    partial void OnMapLongitudeChanged();
    partial void OnMapZoomChanging(System.Nullable<double> value);
    partial void OnMapZoomChanged();
    partial void OnTagIDChanging(System.Nullable<int> value);
    partial void OnTagIDChanged();
    partial void OnContentIDChanging(System.Nullable<int> value);
    partial void OnContentIDChanged();
    #endregion
		
		public Theme()
		{
			this._Tag = default(EntityRef<Tag>);
			this._Map = default(EntityRef<Map>);
			this._Content = default(EntityRef<Content>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LinkName", DbType="VarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
		public string LinkName
		{
			get
			{
				return this._LinkName;
			}
			set
			{
				if ((this._LinkName != value))
				{
					this.OnLinkNameChanging(value);
					this.SendPropertyChanging();
					this._LinkName = value;
					this.SendPropertyChanged("LinkName");
					this.OnLinkNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="VarChar(50) NOT NULL", CanBeNull=false)]
		public string Name
		{
			get
			{
				return this._Name;
			}
			set
			{
				if ((this._Name != value))
				{
					this.OnNameChanging(value);
					this.SendPropertyChanging();
					this._Name = value;
					this.SendPropertyChanged("Name");
					this.OnNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MapID", DbType="Int")]
		public System.Nullable<int> MapID
		{
			get
			{
				return this._MapID;
			}
			set
			{
				if ((this._MapID != value))
				{
					if (this._Map.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnMapIDChanging(value);
					this.SendPropertyChanging();
					this._MapID = value;
					this.SendPropertyChanged("MapID");
					this.OnMapIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MapLatitude", DbType="Decimal(9,6)")]
		public System.Nullable<decimal> MapLatitude
		{
			get
			{
				return this._MapLatitude;
			}
			set
			{
				if ((this._MapLatitude != value))
				{
					this.OnMapLatitudeChanging(value);
					this.SendPropertyChanging();
					this._MapLatitude = value;
					this.SendPropertyChanged("MapLatitude");
					this.OnMapLatitudeChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MapLongitude", DbType="Decimal(9,6)")]
		public System.Nullable<decimal> MapLongitude
		{
			get
			{
				return this._MapLongitude;
			}
			set
			{
				if ((this._MapLongitude != value))
				{
					this.OnMapLongitudeChanging(value);
					this.SendPropertyChanging();
					this._MapLongitude = value;
					this.SendPropertyChanged("MapLongitude");
					this.OnMapLongitudeChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MapZoom", DbType="Float")]
		public System.Nullable<double> MapZoom
		{
			get
			{
				return this._MapZoom;
			}
			set
			{
				if ((this._MapZoom != value))
				{
					this.OnMapZoomChanging(value);
					this.SendPropertyChanging();
					this._MapZoom = value;
					this.SendPropertyChanged("MapZoom");
					this.OnMapZoomChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TagID", DbType="Int")]
		public System.Nullable<int> TagID
		{
			get
			{
				return this._TagID;
			}
			set
			{
				if ((this._TagID != value))
				{
					if (this._Tag.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnTagIDChanging(value);
					this.SendPropertyChanging();
					this._TagID = value;
					this.SendPropertyChanged("TagID");
					this.OnTagIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContentID", DbType="Int")]
		public System.Nullable<int> ContentID
		{
			get
			{
				return this._ContentID;
			}
			set
			{
				if ((this._ContentID != value))
				{
					if (this._Content.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnContentIDChanging(value);
					this.SendPropertyChanging();
					this._ContentID = value;
					this.SendPropertyChanged("ContentID");
					this.OnContentIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Tag_Theme", Storage="_Tag", ThisKey="TagID", OtherKey="TagID", IsForeignKey=true)]
		public Tag Tag
		{
			get
			{
				return this._Tag.Entity;
			}
			set
			{
				Tag previousValue = this._Tag.Entity;
				if (((previousValue != value) 
							|| (this._Tag.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Tag.Entity = null;
						previousValue.Themes.Remove(this);
					}
					this._Tag.Entity = value;
					if ((value != null))
					{
						value.Themes.Add(this);
						this._TagID = value.TagID;
					}
					else
					{
						this._TagID = default(Nullable<int>);
					}
					this.SendPropertyChanged("Tag");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Map_Theme", Storage="_Map", ThisKey="MapID", OtherKey="MapID", IsForeignKey=true)]
		public Map Map
		{
			get
			{
				return this._Map.Entity;
			}
			set
			{
				Map previousValue = this._Map.Entity;
				if (((previousValue != value) 
							|| (this._Map.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Map.Entity = null;
						previousValue.Themes.Remove(this);
					}
					this._Map.Entity = value;
					if ((value != null))
					{
						value.Themes.Add(this);
						this._MapID = value.MapID;
					}
					else
					{
						this._MapID = default(Nullable<int>);
					}
					this.SendPropertyChanged("Map");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Content_Theme", Storage="_Content", ThisKey="ContentID", OtherKey="ContentID", IsForeignKey=true)]
		public Content Content
		{
			get
			{
				return this._Content.Entity;
			}
			set
			{
				Content previousValue = this._Content.Entity;
				if (((previousValue != value) 
							|| (this._Content.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Content.Entity = null;
						previousValue.Themes.Remove(this);
					}
					this._Content.Entity = value;
					if ((value != null))
					{
						value.Themes.Add(this);
						this._ContentID = value.ContentID;
					}
					else
					{
						this._ContentID = default(Nullable<int>);
					}
					this.SendPropertyChanged("Content");
				}
			}
		}
		
		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));
			}
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Tag")]
	public partial class Tag : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _TagID;
		
		private string _PlurName;
		
		private string _SingName;
		
		private byte _Category;
		
		private System.Nullable<short> _YearStart;
		
		private System.Nullable<short> _YearEnd;
		
		private System.Nullable<short> _TableID;
		
		private System.Nullable<int> _ContentID;
		
		private System.DateTime _Created;
		
		private System.Nullable<System.DateTime> _Deleted;
		
		private System.DateTime _LastModified;
		
		private EntitySet<Licen> _Licens;
		
		private EntitySet<Tag_Content> _Tag_Contents;
		
		private EntitySet<Tag_Geo> _Tag_Geos;
		
		private EntitySet<Tag_Image> _Tag_Images;
		
		private EntitySet<TagHierarki> _TagHierarkis;
		
		private EntitySet<TagHierarki> _TagHierarkis1;
		
		private EntitySet<Theme> _Themes;
		
		private EntitySet<Geo> _Geos;
		
		private EntitySet<Map> _Maps;
		
		private EntitySet<Institution> _Institutions;
		
		private EntityRef<Content> _Content;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnTagIDChanging(int value);
    partial void OnTagIDChanged();
    partial void OnPlurNameChanging(string value);
    partial void OnPlurNameChanged();
    partial void OnSingNameChanging(string value);
    partial void OnSingNameChanged();
    partial void OnCategoryChanging(byte value);
    partial void OnCategoryChanged();
    partial void OnYearStartChanging(System.Nullable<short> value);
    partial void OnYearStartChanged();
    partial void OnYearEndChanging(System.Nullable<short> value);
    partial void OnYearEndChanged();
    partial void OnTableIDChanging(System.Nullable<short> value);
    partial void OnTableIDChanged();
    partial void OnContentIDChanging(System.Nullable<int> value);
    partial void OnContentIDChanged();
    partial void OnCreatedChanging(System.DateTime value);
    partial void OnCreatedChanged();
    partial void OnDeletedChanging(System.Nullable<System.DateTime> value);
    partial void OnDeletedChanged();
    partial void OnLastModifiedChanging(System.DateTime value);
    partial void OnLastModifiedChanged();
    #endregion
		
		public Tag()
		{
			this._Licens = new EntitySet<Licen>(new Action<Licen>(this.attach_Licens), new Action<Licen>(this.detach_Licens));
			this._Tag_Contents = new EntitySet<Tag_Content>(new Action<Tag_Content>(this.attach_Tag_Contents), new Action<Tag_Content>(this.detach_Tag_Contents));
			this._Tag_Geos = new EntitySet<Tag_Geo>(new Action<Tag_Geo>(this.attach_Tag_Geos), new Action<Tag_Geo>(this.detach_Tag_Geos));
			this._Tag_Images = new EntitySet<Tag_Image>(new Action<Tag_Image>(this.attach_Tag_Images), new Action<Tag_Image>(this.detach_Tag_Images));
			this._TagHierarkis = new EntitySet<TagHierarki>(new Action<TagHierarki>(this.attach_TagHierarkis), new Action<TagHierarki>(this.detach_TagHierarkis));
			this._TagHierarkis1 = new EntitySet<TagHierarki>(new Action<TagHierarki>(this.attach_TagHierarkis1), new Action<TagHierarki>(this.detach_TagHierarkis1));
			this._Themes = new EntitySet<Theme>(new Action<Theme>(this.attach_Themes), new Action<Theme>(this.detach_Themes));
			this._Geos = new EntitySet<Geo>(new Action<Geo>(this.attach_Geos), new Action<Geo>(this.detach_Geos));
			this._Maps = new EntitySet<Map>(new Action<Map>(this.attach_Maps), new Action<Map>(this.detach_Maps));
			this._Institutions = new EntitySet<Institution>(new Action<Institution>(this.attach_Institutions), new Action<Institution>(this.detach_Institutions));
			this._Content = default(EntityRef<Content>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TagID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int TagID
		{
			get
			{
				return this._TagID;
			}
			set
			{
				if ((this._TagID != value))
				{
					this.OnTagIDChanging(value);
					this.SendPropertyChanging();
					this._TagID = value;
					this.SendPropertyChanged("TagID");
					this.OnTagIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PlurName", DbType="VarChar(50) NOT NULL", CanBeNull=false)]
		public string PlurName
		{
			get
			{
				return this._PlurName;
			}
			set
			{
				if ((this._PlurName != value))
				{
					this.OnPlurNameChanging(value);
					this.SendPropertyChanging();
					this._PlurName = value;
					this.SendPropertyChanged("PlurName");
					this.OnPlurNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SingName", DbType="VarChar(50) NOT NULL", CanBeNull=false)]
		public string SingName
		{
			get
			{
				return this._SingName;
			}
			set
			{
				if ((this._SingName != value))
				{
					this.OnSingNameChanging(value);
					this.SendPropertyChanging();
					this._SingName = value;
					this.SendPropertyChanged("SingName");
					this.OnSingNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Category", DbType="TinyInt NOT NULL")]
		public byte Category
		{
			get
			{
				return this._Category;
			}
			set
			{
				if ((this._Category != value))
				{
					this.OnCategoryChanging(value);
					this.SendPropertyChanging();
					this._Category = value;
					this.SendPropertyChanged("Category");
					this.OnCategoryChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_YearStart", DbType="SmallInt")]
		public System.Nullable<short> YearStart
		{
			get
			{
				return this._YearStart;
			}
			set
			{
				if ((this._YearStart != value))
				{
					this.OnYearStartChanging(value);
					this.SendPropertyChanging();
					this._YearStart = value;
					this.SendPropertyChanged("YearStart");
					this.OnYearStartChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_YearEnd", DbType="SmallInt")]
		public System.Nullable<short> YearEnd
		{
			get
			{
				return this._YearEnd;
			}
			set
			{
				if ((this._YearEnd != value))
				{
					this.OnYearEndChanging(value);
					this.SendPropertyChanging();
					this._YearEnd = value;
					this.SendPropertyChanged("YearEnd");
					this.OnYearEndChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TableID", DbType="SmallInt")]
		public System.Nullable<short> TableID
		{
			get
			{
				return this._TableID;
			}
			set
			{
				if ((this._TableID != value))
				{
					this.OnTableIDChanging(value);
					this.SendPropertyChanging();
					this._TableID = value;
					this.SendPropertyChanged("TableID");
					this.OnTableIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContentID", DbType="Int")]
		public System.Nullable<int> ContentID
		{
			get
			{
				return this._ContentID;
			}
			set
			{
				if ((this._ContentID != value))
				{
					if (this._Content.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnContentIDChanging(value);
					this.SendPropertyChanging();
					this._ContentID = value;
					this.SendPropertyChanged("ContentID");
					this.OnContentIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Created", DbType="DateTime NOT NULL")]
		public System.DateTime Created
		{
			get
			{
				return this._Created;
			}
			set
			{
				if ((this._Created != value))
				{
					this.OnCreatedChanging(value);
					this.SendPropertyChanging();
					this._Created = value;
					this.SendPropertyChanged("Created");
					this.OnCreatedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Deleted", DbType="DateTime")]
		public System.Nullable<System.DateTime> Deleted
		{
			get
			{
				return this._Deleted;
			}
			set
			{
				if ((this._Deleted != value))
				{
					this.OnDeletedChanging(value);
					this.SendPropertyChanging();
					this._Deleted = value;
					this.SendPropertyChanged("Deleted");
					this.OnDeletedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LastModified", DbType="DateTime NOT NULL")]
		public System.DateTime LastModified
		{
			get
			{
				return this._LastModified;
			}
			set
			{
				if ((this._LastModified != value))
				{
					this.OnLastModifiedChanging(value);
					this.SendPropertyChanging();
					this._LastModified = value;
					this.SendPropertyChanged("LastModified");
					this.OnLastModifiedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Tag_Licen", Storage="_Licens", ThisKey="TagID", OtherKey="TagID")]
		public EntitySet<Licen> Licens
		{
			get
			{
				return this._Licens;
			}
			set
			{
				this._Licens.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Tag_Tag_Content", Storage="_Tag_Contents", ThisKey="TagID", OtherKey="TagID")]
		public EntitySet<Tag_Content> Tag_Contents
		{
			get
			{
				return this._Tag_Contents;
			}
			set
			{
				this._Tag_Contents.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Tag_Tag_Geo", Storage="_Tag_Geos", ThisKey="TagID", OtherKey="TagID")]
		public EntitySet<Tag_Geo> Tag_Geos
		{
			get
			{
				return this._Tag_Geos;
			}
			set
			{
				this._Tag_Geos.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Tag_Tag_Image", Storage="_Tag_Images", ThisKey="TagID", OtherKey="TagID")]
		public EntitySet<Tag_Image> Tag_Images
		{
			get
			{
				return this._Tag_Images;
			}
			set
			{
				this._Tag_Images.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Tag_TagHierarki", Storage="_TagHierarkis", ThisKey="TagID", OtherKey="UpperTagID")]
		public EntitySet<TagHierarki> TagHierarkis
		{
			get
			{
				return this._TagHierarkis;
			}
			set
			{
				this._TagHierarkis.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Tag_TagHierarki1", Storage="_TagHierarkis1", ThisKey="TagID", OtherKey="TagID")]
		public EntitySet<TagHierarki> TagHierarkis1
		{
			get
			{
				return this._TagHierarkis1;
			}
			set
			{
				this._TagHierarkis1.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Tag_Theme", Storage="_Themes", ThisKey="TagID", OtherKey="TagID")]
		public EntitySet<Theme> Themes
		{
			get
			{
				return this._Themes;
			}
			set
			{
				this._Themes.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Tag_Geo", Storage="_Geos", ThisKey="TagID", OtherKey="PrimaryTagID")]
		public EntitySet<Geo> Geos
		{
			get
			{
				return this._Geos;
			}
			set
			{
				this._Geos.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Tag_Map", Storage="_Maps", ThisKey="TagID", OtherKey="LicensTagID")]
		public EntitySet<Map> Maps
		{
			get
			{
				return this._Maps;
			}
			set
			{
				this._Maps.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Tag_Institution", Storage="_Institutions", ThisKey="TagID", OtherKey="TagID")]
		public EntitySet<Institution> Institutions
		{
			get
			{
				return this._Institutions;
			}
			set
			{
				this._Institutions.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Content_Tag", Storage="_Content", ThisKey="ContentID", OtherKey="ContentID", IsForeignKey=true)]
		public Content Content
		{
			get
			{
				return this._Content.Entity;
			}
			set
			{
				Content previousValue = this._Content.Entity;
				if (((previousValue != value) 
							|| (this._Content.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Content.Entity = null;
						previousValue.Tags.Remove(this);
					}
					this._Content.Entity = value;
					if ((value != null))
					{
						value.Tags.Add(this);
						this._ContentID = value.ContentID;
					}
					else
					{
						this._ContentID = default(Nullable<int>);
					}
					this.SendPropertyChanged("Content");
				}
			}
		}
		
		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));
			}
		}
		
		private void attach_Licens(Licen entity)
		{
			this.SendPropertyChanging();
			entity.Tag = this;
		}
		
		private void detach_Licens(Licen entity)
		{
			this.SendPropertyChanging();
			entity.Tag = null;
		}
		
		private void attach_Tag_Contents(Tag_Content entity)
		{
			this.SendPropertyChanging();
			entity.Tag = this;
		}
		
		private void detach_Tag_Contents(Tag_Content entity)
		{
			this.SendPropertyChanging();
			entity.Tag = null;
		}
		
		private void attach_Tag_Geos(Tag_Geo entity)
		{
			this.SendPropertyChanging();
			entity.Tag = this;
		}
		
		private void detach_Tag_Geos(Tag_Geo entity)
		{
			this.SendPropertyChanging();
			entity.Tag = null;
		}
		
		private void attach_Tag_Images(Tag_Image entity)
		{
			this.SendPropertyChanging();
			entity.Tag = this;
		}
		
		private void detach_Tag_Images(Tag_Image entity)
		{
			this.SendPropertyChanging();
			entity.Tag = null;
		}
		
		private void attach_TagHierarkis(TagHierarki entity)
		{
			this.SendPropertyChanging();
			entity.Tag = this;
		}
		
		private void detach_TagHierarkis(TagHierarki entity)
		{
			this.SendPropertyChanging();
			entity.Tag = null;
		}
		
		private void attach_TagHierarkis1(TagHierarki entity)
		{
			this.SendPropertyChanging();
			entity.Tag1 = this;
		}
		
		private void detach_TagHierarkis1(TagHierarki entity)
		{
			this.SendPropertyChanging();
			entity.Tag1 = null;
		}
		
		private void attach_Themes(Theme entity)
		{
			this.SendPropertyChanging();
			entity.Tag = this;
		}
		
		private void detach_Themes(Theme entity)
		{
			this.SendPropertyChanging();
			entity.Tag = null;
		}
		
		private void attach_Geos(Geo entity)
		{
			this.SendPropertyChanging();
			entity.Tag = this;
		}
		
		private void detach_Geos(Geo entity)
		{
			this.SendPropertyChanging();
			entity.Tag = null;
		}
		
		private void attach_Maps(Map entity)
		{
			this.SendPropertyChanging();
			entity.Tag = this;
		}
		
		private void detach_Maps(Map entity)
		{
			this.SendPropertyChanging();
			entity.Tag = null;
		}
		
		private void attach_Institutions(Institution entity)
		{
			this.SendPropertyChanging();
			entity.Tag = this;
		}
		
		private void detach_Institutions(Institution entity)
		{
			this.SendPropertyChanging();
			entity.Tag = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Geo")]
	public partial class Geo : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _GeoID;
		
		private string _Title;
		
		private string _Intro;
		
		private System.Nullable<int> _PrimaryTagID;
		
		private bool _PrimaryTagStatic;
		
		private string _FreeTags;
		
		private System.Nullable<int> _YearStart;
		
		private System.Nullable<int> _YearEnd;
		
		private decimal _Latitude;
		
		private decimal _Longitude;
		
		private bool _Online;
		
		private bool _UGC;
		
		private int _Views;
		
		private bool _Deleted;
		
		private int _UserID;
		
		private System.DateTime _Created;
		
		private EntitySet<Geo_Image> _Geo_Images;
		
		private EntitySet<Tag_Geo> _Tag_Geos;
		
		private EntitySet<Collection_Geo> _Collection_Geos;
		
		private EntitySet<Content> _Contents;
		
		private EntityRef<Tag> _Tag;
		
		private EntityRef<User> _User;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnGeoIDChanging(int value);
    partial void OnGeoIDChanged();
    partial void OnTitleChanging(string value);
    partial void OnTitleChanged();
    partial void OnIntroChanging(string value);
    partial void OnIntroChanged();
    partial void OnPrimaryTagIDChanging(System.Nullable<int> value);
    partial void OnPrimaryTagIDChanged();
    partial void OnPrimaryTagStaticChanging(bool value);
    partial void OnPrimaryTagStaticChanged();
    partial void OnFreeTagsChanging(string value);
    partial void OnFreeTagsChanged();
    partial void OnYearStartChanging(System.Nullable<int> value);
    partial void OnYearStartChanged();
    partial void OnYearEndChanging(System.Nullable<int> value);
    partial void OnYearEndChanged();
    partial void OnLatitudeChanging(decimal value);
    partial void OnLatitudeChanged();
    partial void OnLongitudeChanging(decimal value);
    partial void OnLongitudeChanged();
    partial void OnOnlineChanging(bool value);
    partial void OnOnlineChanged();
    partial void OnUGCChanging(bool value);
    partial void OnUGCChanged();
    partial void OnViewsChanging(int value);
    partial void OnViewsChanged();
    partial void OnDeletedChanging(bool value);
    partial void OnDeletedChanged();
    partial void OnUserIDChanging(int value);
    partial void OnUserIDChanged();
    partial void OnCreatedChanging(System.DateTime value);
    partial void OnCreatedChanged();
    #endregion
		
		public Geo()
		{
			this._Geo_Images = new EntitySet<Geo_Image>(new Action<Geo_Image>(this.attach_Geo_Images), new Action<Geo_Image>(this.detach_Geo_Images));
			this._Tag_Geos = new EntitySet<Tag_Geo>(new Action<Tag_Geo>(this.attach_Tag_Geos), new Action<Tag_Geo>(this.detach_Tag_Geos));
			this._Collection_Geos = new EntitySet<Collection_Geo>(new Action<Collection_Geo>(this.attach_Collection_Geos), new Action<Collection_Geo>(this.detach_Collection_Geos));
			this._Contents = new EntitySet<Content>(new Action<Content>(this.attach_Contents), new Action<Content>(this.detach_Contents));
			this._Tag = default(EntityRef<Tag>);
			this._User = default(EntityRef<User>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GeoID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int GeoID
		{
			get
			{
				return this._GeoID;
			}
			set
			{
				if ((this._GeoID != value))
				{
					this.OnGeoIDChanging(value);
					this.SendPropertyChanging();
					this._GeoID = value;
					this.SendPropertyChanged("GeoID");
					this.OnGeoIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Title", DbType="VarChar(255) NOT NULL", CanBeNull=false)]
		public string Title
		{
			get
			{
				return this._Title;
			}
			set
			{
				if ((this._Title != value))
				{
					this.OnTitleChanging(value);
					this.SendPropertyChanging();
					this._Title = value;
					this.SendPropertyChanged("Title");
					this.OnTitleChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Intro", DbType="VarChar(300) NOT NULL", CanBeNull=false)]
		public string Intro
		{
			get
			{
				return this._Intro;
			}
			set
			{
				if ((this._Intro != value))
				{
					this.OnIntroChanging(value);
					this.SendPropertyChanging();
					this._Intro = value;
					this.SendPropertyChanged("Intro");
					this.OnIntroChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PrimaryTagID", DbType="Int")]
		public System.Nullable<int> PrimaryTagID
		{
			get
			{
				return this._PrimaryTagID;
			}
			set
			{
				if ((this._PrimaryTagID != value))
				{
					if (this._Tag.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnPrimaryTagIDChanging(value);
					this.SendPropertyChanging();
					this._PrimaryTagID = value;
					this.SendPropertyChanged("PrimaryTagID");
					this.OnPrimaryTagIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PrimaryTagStatic", DbType="Bit NOT NULL")]
		public bool PrimaryTagStatic
		{
			get
			{
				return this._PrimaryTagStatic;
			}
			set
			{
				if ((this._PrimaryTagStatic != value))
				{
					this.OnPrimaryTagStaticChanging(value);
					this.SendPropertyChanging();
					this._PrimaryTagStatic = value;
					this.SendPropertyChanged("PrimaryTagStatic");
					this.OnPrimaryTagStaticChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FreeTags", DbType="VarChar(255) NOT NULL", CanBeNull=false)]
		public string FreeTags
		{
			get
			{
				return this._FreeTags;
			}
			set
			{
				if ((this._FreeTags != value))
				{
					this.OnFreeTagsChanging(value);
					this.SendPropertyChanging();
					this._FreeTags = value;
					this.SendPropertyChanged("FreeTags");
					this.OnFreeTagsChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_YearStart", DbType="Int")]
		public System.Nullable<int> YearStart
		{
			get
			{
				return this._YearStart;
			}
			set
			{
				if ((this._YearStart != value))
				{
					this.OnYearStartChanging(value);
					this.SendPropertyChanging();
					this._YearStart = value;
					this.SendPropertyChanged("YearStart");
					this.OnYearStartChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_YearEnd", DbType="Int")]
		public System.Nullable<int> YearEnd
		{
			get
			{
				return this._YearEnd;
			}
			set
			{
				if ((this._YearEnd != value))
				{
					this.OnYearEndChanging(value);
					this.SendPropertyChanging();
					this._YearEnd = value;
					this.SendPropertyChanged("YearEnd");
					this.OnYearEndChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Latitude", DbType="Decimal(9,6) NOT NULL")]
		public decimal Latitude
		{
			get
			{
				return this._Latitude;
			}
			set
			{
				if ((this._Latitude != value))
				{
					this.OnLatitudeChanging(value);
					this.SendPropertyChanging();
					this._Latitude = value;
					this.SendPropertyChanged("Latitude");
					this.OnLatitudeChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Longitude", DbType="Decimal(9,6) NOT NULL")]
		public decimal Longitude
		{
			get
			{
				return this._Longitude;
			}
			set
			{
				if ((this._Longitude != value))
				{
					this.OnLongitudeChanging(value);
					this.SendPropertyChanging();
					this._Longitude = value;
					this.SendPropertyChanged("Longitude");
					this.OnLongitudeChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Online", DbType="Bit NOT NULL")]
		public bool Online
		{
			get
			{
				return this._Online;
			}
			set
			{
				if ((this._Online != value))
				{
					this.OnOnlineChanging(value);
					this.SendPropertyChanging();
					this._Online = value;
					this.SendPropertyChanged("Online");
					this.OnOnlineChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UGC", DbType="Bit NOT NULL")]
		public bool UGC
		{
			get
			{
				return this._UGC;
			}
			set
			{
				if ((this._UGC != value))
				{
					this.OnUGCChanging(value);
					this.SendPropertyChanging();
					this._UGC = value;
					this.SendPropertyChanged("UGC");
					this.OnUGCChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Views", DbType="Int NOT NULL")]
		public int Views
		{
			get
			{
				return this._Views;
			}
			set
			{
				if ((this._Views != value))
				{
					this.OnViewsChanging(value);
					this.SendPropertyChanging();
					this._Views = value;
					this.SendPropertyChanged("Views");
					this.OnViewsChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Deleted", DbType="Bit NOT NULL")]
		public bool Deleted
		{
			get
			{
				return this._Deleted;
			}
			set
			{
				if ((this._Deleted != value))
				{
					this.OnDeletedChanging(value);
					this.SendPropertyChanging();
					this._Deleted = value;
					this.SendPropertyChanged("Deleted");
					this.OnDeletedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserID", DbType="Int NOT NULL")]
		public int UserID
		{
			get
			{
				return this._UserID;
			}
			set
			{
				if ((this._UserID != value))
				{
					if (this._User.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnUserIDChanging(value);
					this.SendPropertyChanging();
					this._UserID = value;
					this.SendPropertyChanged("UserID");
					this.OnUserIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Created", DbType="DateTime NOT NULL")]
		public System.DateTime Created
		{
			get
			{
				return this._Created;
			}
			set
			{
				if ((this._Created != value))
				{
					this.OnCreatedChanging(value);
					this.SendPropertyChanging();
					this._Created = value;
					this.SendPropertyChanged("Created");
					this.OnCreatedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Geo_Geo_Image", Storage="_Geo_Images", ThisKey="GeoID", OtherKey="GeoID")]
		public EntitySet<Geo_Image> Geo_Images
		{
			get
			{
				return this._Geo_Images;
			}
			set
			{
				this._Geo_Images.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Geo_Tag_Geo", Storage="_Tag_Geos", ThisKey="GeoID", OtherKey="GeoID")]
		public EntitySet<Tag_Geo> Tag_Geos
		{
			get
			{
				return this._Tag_Geos;
			}
			set
			{
				this._Tag_Geos.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Geo_Collection_Geo", Storage="_Collection_Geos", ThisKey="GeoID", OtherKey="GeoID")]
		public EntitySet<Collection_Geo> Collection_Geos
		{
			get
			{
				return this._Collection_Geos;
			}
			set
			{
				this._Collection_Geos.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Geo_Content", Storage="_Contents", ThisKey="GeoID", OtherKey="GeoID")]
		public EntitySet<Content> Contents
		{
			get
			{
				return this._Contents;
			}
			set
			{
				this._Contents.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Tag_Geo", Storage="_Tag", ThisKey="PrimaryTagID", OtherKey="TagID", IsForeignKey=true)]
		public Tag Tag
		{
			get
			{
				return this._Tag.Entity;
			}
			set
			{
				Tag previousValue = this._Tag.Entity;
				if (((previousValue != value) 
							|| (this._Tag.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Tag.Entity = null;
						previousValue.Geos.Remove(this);
					}
					this._Tag.Entity = value;
					if ((value != null))
					{
						value.Geos.Add(this);
						this._PrimaryTagID = value.TagID;
					}
					else
					{
						this._PrimaryTagID = default(Nullable<int>);
					}
					this.SendPropertyChanged("Tag");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_Geo", Storage="_User", ThisKey="UserID", OtherKey="UserID", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]
		public User User
		{
			get
			{
				return this._User.Entity;
			}
			set
			{
				User previousValue = this._User.Entity;
				if (((previousValue != value) 
							|| (this._User.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._User.Entity = null;
						previousValue.Geos.Remove(this);
					}
					this._User.Entity = value;
					if ((value != null))
					{
						value.Geos.Add(this);
						this._UserID = value.UserID;
					}
					else
					{
						this._UserID = default(int);
					}
					this.SendPropertyChanged("User");
				}
			}
		}
		
		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));
			}
		}
		
		private void attach_Geo_Images(Geo_Image entity)
		{
			this.SendPropertyChanging();
			entity.Geo = this;
		}
		
		private void detach_Geo_Images(Geo_Image entity)
		{
			this.SendPropertyChanging();
			entity.Geo = null;
		}
		
		private void attach_Tag_Geos(Tag_Geo entity)
		{
			this.SendPropertyChanging();
			entity.Geo = this;
		}
		
		private void detach_Tag_Geos(Tag_Geo entity)
		{
			this.SendPropertyChanging();
			entity.Geo = null;
		}
		
		private void attach_Collection_Geos(Collection_Geo entity)
		{
			this.SendPropertyChanging();
			entity.Geo = this;
		}
		
		private void detach_Collection_Geos(Collection_Geo entity)
		{
			this.SendPropertyChanging();
			entity.Geo = null;
		}
		
		private void attach_Contents(Content entity)
		{
			this.SendPropertyChanging();
			entity.Geo = this;
		}
		
		private void detach_Contents(Content entity)
		{
			this.SendPropertyChanging();
			entity.Geo = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Collection")]
	public partial class Collection : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _CollectionID;
		
		private string _Title;
		
		private int _UserID;
		
		private System.Nullable<int> _ContentID;
		
		private int _Distance;
		
		private byte _Type;
		
		private bool _Online;
		
		private bool _UGC;
		
		private bool _Cyclic;
		
		private System.DateTime _Created;
		
		private System.Nullable<System.DateTime> _Deleted;
		
		private EntitySet<Collection_Geo> _Collection_Geos;
		
		private EntityRef<User> _User;
		
		private EntityRef<Content> _Content;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnCollectionIDChanging(int value);
    partial void OnCollectionIDChanged();
    partial void OnTitleChanging(string value);
    partial void OnTitleChanged();
    partial void OnUserIDChanging(int value);
    partial void OnUserIDChanged();
    partial void OnContentIDChanging(System.Nullable<int> value);
    partial void OnContentIDChanged();
    partial void OnDistanceChanging(int value);
    partial void OnDistanceChanged();
    partial void OnTypeChanging(byte value);
    partial void OnTypeChanged();
    partial void OnOnlineChanging(bool value);
    partial void OnOnlineChanged();
    partial void OnUGCChanging(bool value);
    partial void OnUGCChanged();
    partial void OnCyclicChanging(bool value);
    partial void OnCyclicChanged();
    partial void OnCreatedChanging(System.DateTime value);
    partial void OnCreatedChanged();
    partial void OnDeletedChanging(System.Nullable<System.DateTime> value);
    partial void OnDeletedChanged();
    #endregion
		
		public Collection()
		{
			this._Collection_Geos = new EntitySet<Collection_Geo>(new Action<Collection_Geo>(this.attach_Collection_Geos), new Action<Collection_Geo>(this.detach_Collection_Geos));
			this._User = default(EntityRef<User>);
			this._Content = default(EntityRef<Content>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CollectionID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int CollectionID
		{
			get
			{
				return this._CollectionID;
			}
			set
			{
				if ((this._CollectionID != value))
				{
					this.OnCollectionIDChanging(value);
					this.SendPropertyChanging();
					this._CollectionID = value;
					this.SendPropertyChanged("CollectionID");
					this.OnCollectionIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Title", DbType="VarChar(100) NOT NULL", CanBeNull=false)]
		public string Title
		{
			get
			{
				return this._Title;
			}
			set
			{
				if ((this._Title != value))
				{
					this.OnTitleChanging(value);
					this.SendPropertyChanging();
					this._Title = value;
					this.SendPropertyChanged("Title");
					this.OnTitleChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserID", DbType="Int NOT NULL")]
		public int UserID
		{
			get
			{
				return this._UserID;
			}
			set
			{
				if ((this._UserID != value))
				{
					if (this._User.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnUserIDChanging(value);
					this.SendPropertyChanging();
					this._UserID = value;
					this.SendPropertyChanged("UserID");
					this.OnUserIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContentID", DbType="Int")]
		public System.Nullable<int> ContentID
		{
			get
			{
				return this._ContentID;
			}
			set
			{
				if ((this._ContentID != value))
				{
					if (this._Content.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnContentIDChanging(value);
					this.SendPropertyChanging();
					this._ContentID = value;
					this.SendPropertyChanged("ContentID");
					this.OnContentIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Distance", DbType="Int NOT NULL")]
		public int Distance
		{
			get
			{
				return this._Distance;
			}
			set
			{
				if ((this._Distance != value))
				{
					this.OnDistanceChanging(value);
					this.SendPropertyChanging();
					this._Distance = value;
					this.SendPropertyChanged("Distance");
					this.OnDistanceChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Type", DbType="TinyInt NOT NULL")]
		public byte Type
		{
			get
			{
				return this._Type;
			}
			set
			{
				if ((this._Type != value))
				{
					this.OnTypeChanging(value);
					this.SendPropertyChanging();
					this._Type = value;
					this.SendPropertyChanged("Type");
					this.OnTypeChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Online", DbType="Bit NOT NULL")]
		public bool Online
		{
			get
			{
				return this._Online;
			}
			set
			{
				if ((this._Online != value))
				{
					this.OnOnlineChanging(value);
					this.SendPropertyChanging();
					this._Online = value;
					this.SendPropertyChanged("Online");
					this.OnOnlineChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UGC", DbType="Bit NOT NULL")]
		public bool UGC
		{
			get
			{
				return this._UGC;
			}
			set
			{
				if ((this._UGC != value))
				{
					this.OnUGCChanging(value);
					this.SendPropertyChanging();
					this._UGC = value;
					this.SendPropertyChanged("UGC");
					this.OnUGCChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Cyclic", DbType="Bit NOT NULL")]
		public bool Cyclic
		{
			get
			{
				return this._Cyclic;
			}
			set
			{
				if ((this._Cyclic != value))
				{
					this.OnCyclicChanging(value);
					this.SendPropertyChanging();
					this._Cyclic = value;
					this.SendPropertyChanged("Cyclic");
					this.OnCyclicChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Created", DbType="DateTime NOT NULL")]
		public System.DateTime Created
		{
			get
			{
				return this._Created;
			}
			set
			{
				if ((this._Created != value))
				{
					this.OnCreatedChanging(value);
					this.SendPropertyChanging();
					this._Created = value;
					this.SendPropertyChanged("Created");
					this.OnCreatedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Deleted", DbType="DateTime")]
		public System.Nullable<System.DateTime> Deleted
		{
			get
			{
				return this._Deleted;
			}
			set
			{
				if ((this._Deleted != value))
				{
					this.OnDeletedChanging(value);
					this.SendPropertyChanging();
					this._Deleted = value;
					this.SendPropertyChanged("Deleted");
					this.OnDeletedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Collection_Collection_Geo", Storage="_Collection_Geos", ThisKey="CollectionID", OtherKey="CollectionID")]
		public EntitySet<Collection_Geo> Collection_Geos
		{
			get
			{
				return this._Collection_Geos;
			}
			set
			{
				this._Collection_Geos.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_Collection", Storage="_User", ThisKey="UserID", OtherKey="UserID", IsForeignKey=true)]
		public User User
		{
			get
			{
				return this._User.Entity;
			}
			set
			{
				User previousValue = this._User.Entity;
				if (((previousValue != value) 
							|| (this._User.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._User.Entity = null;
						previousValue.Collections.Remove(this);
					}
					this._User.Entity = value;
					if ((value != null))
					{
						value.Collections.Add(this);
						this._UserID = value.UserID;
					}
					else
					{
						this._UserID = default(int);
					}
					this.SendPropertyChanged("User");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Content_Collection", Storage="_Content", ThisKey="ContentID", OtherKey="ContentID", IsForeignKey=true)]
		public Content Content
		{
			get
			{
				return this._Content.Entity;
			}
			set
			{
				Content previousValue = this._Content.Entity;
				if (((previousValue != value) 
							|| (this._Content.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Content.Entity = null;
						previousValue.Collections.Remove(this);
					}
					this._Content.Entity = value;
					if ((value != null))
					{
						value.Collections.Add(this);
						this._ContentID = value.ContentID;
					}
					else
					{
						this._ContentID = default(Nullable<int>);
					}
					this.SendPropertyChanged("Content");
				}
			}
		}
		
		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));
			}
		}
		
		private void attach_Collection_Geos(Collection_Geo entity)
		{
			this.SendPropertyChanging();
			entity.Collection = this;
		}
		
		private void detach_Collection_Geos(Collection_Geo entity)
		{
			this.SendPropertyChanging();
			entity.Collection = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Collection_Geo")]
	public partial class Collection_Geo : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _CollectionGeoID;
		
		private int _CollectionID;
		
		private System.Nullable<int> _GeoID;
		
		private int _Ordering;
		
		private bool _ShowOnMap;
		
		private bool _CalcRoute;
		
		private System.Nullable<int> _ContentID;
		
		private System.Nullable<decimal> _Latitude;
		
		private System.Nullable<decimal> _Longitude;
		
		private System.DateTime _Created;
		
		private System.Nullable<System.DateTime> _Deleted;
		
		private EntityRef<Collection> _Collection;
		
		private EntityRef<Geo> _Geo;
		
		private EntityRef<Content> _Content;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnCollectionGeoIDChanging(int value);
    partial void OnCollectionGeoIDChanged();
    partial void OnCollectionIDChanging(int value);
    partial void OnCollectionIDChanged();
    partial void OnGeoIDChanging(System.Nullable<int> value);
    partial void OnGeoIDChanged();
    partial void OnOrderingChanging(int value);
    partial void OnOrderingChanged();
    partial void OnShowOnMapChanging(bool value);
    partial void OnShowOnMapChanged();
    partial void OnCalcRouteChanging(bool value);
    partial void OnCalcRouteChanged();
    partial void OnContentIDChanging(System.Nullable<int> value);
    partial void OnContentIDChanged();
    partial void OnLatitudeChanging(System.Nullable<decimal> value);
    partial void OnLatitudeChanged();
    partial void OnLongitudeChanging(System.Nullable<decimal> value);
    partial void OnLongitudeChanged();
    partial void OnCreatedChanging(System.DateTime value);
    partial void OnCreatedChanged();
    partial void OnDeletedChanging(System.Nullable<System.DateTime> value);
    partial void OnDeletedChanged();
    #endregion
		
		public Collection_Geo()
		{
			this._Collection = default(EntityRef<Collection>);
			this._Geo = default(EntityRef<Geo>);
			this._Content = default(EntityRef<Content>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CollectionGeoID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int CollectionGeoID
		{
			get
			{
				return this._CollectionGeoID;
			}
			set
			{
				if ((this._CollectionGeoID != value))
				{
					this.OnCollectionGeoIDChanging(value);
					this.SendPropertyChanging();
					this._CollectionGeoID = value;
					this.SendPropertyChanged("CollectionGeoID");
					this.OnCollectionGeoIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CollectionID", DbType="Int NOT NULL")]
		public int CollectionID
		{
			get
			{
				return this._CollectionID;
			}
			set
			{
				if ((this._CollectionID != value))
				{
					if (this._Collection.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnCollectionIDChanging(value);
					this.SendPropertyChanging();
					this._CollectionID = value;
					this.SendPropertyChanged("CollectionID");
					this.OnCollectionIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GeoID", DbType="Int")]
		public System.Nullable<int> GeoID
		{
			get
			{
				return this._GeoID;
			}
			set
			{
				if ((this._GeoID != value))
				{
					if (this._Geo.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnGeoIDChanging(value);
					this.SendPropertyChanging();
					this._GeoID = value;
					this.SendPropertyChanged("GeoID");
					this.OnGeoIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Ordering", DbType="Int NOT NULL")]
		public int Ordering
		{
			get
			{
				return this._Ordering;
			}
			set
			{
				if ((this._Ordering != value))
				{
					this.OnOrderingChanging(value);
					this.SendPropertyChanging();
					this._Ordering = value;
					this.SendPropertyChanged("Ordering");
					this.OnOrderingChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ShowOnMap", DbType="Bit NOT NULL")]
		public bool ShowOnMap
		{
			get
			{
				return this._ShowOnMap;
			}
			set
			{
				if ((this._ShowOnMap != value))
				{
					this.OnShowOnMapChanging(value);
					this.SendPropertyChanging();
					this._ShowOnMap = value;
					this.SendPropertyChanged("ShowOnMap");
					this.OnShowOnMapChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CalcRoute", DbType="Bit NOT NULL")]
		public bool CalcRoute
		{
			get
			{
				return this._CalcRoute;
			}
			set
			{
				if ((this._CalcRoute != value))
				{
					this.OnCalcRouteChanging(value);
					this.SendPropertyChanging();
					this._CalcRoute = value;
					this.SendPropertyChanged("CalcRoute");
					this.OnCalcRouteChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContentID", DbType="Int")]
		public System.Nullable<int> ContentID
		{
			get
			{
				return this._ContentID;
			}
			set
			{
				if ((this._ContentID != value))
				{
					if (this._Content.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnContentIDChanging(value);
					this.SendPropertyChanging();
					this._ContentID = value;
					this.SendPropertyChanged("ContentID");
					this.OnContentIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Latitude", DbType="Decimal(9,6)")]
		public System.Nullable<decimal> Latitude
		{
			get
			{
				return this._Latitude;
			}
			set
			{
				if ((this._Latitude != value))
				{
					this.OnLatitudeChanging(value);
					this.SendPropertyChanging();
					this._Latitude = value;
					this.SendPropertyChanged("Latitude");
					this.OnLatitudeChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Longitude", DbType="Decimal(9,6)")]
		public System.Nullable<decimal> Longitude
		{
			get
			{
				return this._Longitude;
			}
			set
			{
				if ((this._Longitude != value))
				{
					this.OnLongitudeChanging(value);
					this.SendPropertyChanging();
					this._Longitude = value;
					this.SendPropertyChanged("Longitude");
					this.OnLongitudeChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Created", DbType="DateTime NOT NULL")]
		public System.DateTime Created
		{
			get
			{
				return this._Created;
			}
			set
			{
				if ((this._Created != value))
				{
					this.OnCreatedChanging(value);
					this.SendPropertyChanging();
					this._Created = value;
					this.SendPropertyChanged("Created");
					this.OnCreatedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Deleted", DbType="DateTime")]
		public System.Nullable<System.DateTime> Deleted
		{
			get
			{
				return this._Deleted;
			}
			set
			{
				if ((this._Deleted != value))
				{
					this.OnDeletedChanging(value);
					this.SendPropertyChanging();
					this._Deleted = value;
					this.SendPropertyChanged("Deleted");
					this.OnDeletedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Collection_Collection_Geo", Storage="_Collection", ThisKey="CollectionID", OtherKey="CollectionID", IsForeignKey=true)]
		public Collection Collection
		{
			get
			{
				return this._Collection.Entity;
			}
			set
			{
				Collection previousValue = this._Collection.Entity;
				if (((previousValue != value) 
							|| (this._Collection.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Collection.Entity = null;
						previousValue.Collection_Geos.Remove(this);
					}
					this._Collection.Entity = value;
					if ((value != null))
					{
						value.Collection_Geos.Add(this);
						this._CollectionID = value.CollectionID;
					}
					else
					{
						this._CollectionID = default(int);
					}
					this.SendPropertyChanged("Collection");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Geo_Collection_Geo", Storage="_Geo", ThisKey="GeoID", OtherKey="GeoID", IsForeignKey=true)]
		public Geo Geo
		{
			get
			{
				return this._Geo.Entity;
			}
			set
			{
				Geo previousValue = this._Geo.Entity;
				if (((previousValue != value) 
							|| (this._Geo.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Geo.Entity = null;
						previousValue.Collection_Geos.Remove(this);
					}
					this._Geo.Entity = value;
					if ((value != null))
					{
						value.Collection_Geos.Add(this);
						this._GeoID = value.GeoID;
					}
					else
					{
						this._GeoID = default(Nullable<int>);
					}
					this.SendPropertyChanged("Geo");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Content_Collection_Geo", Storage="_Content", ThisKey="ContentID", OtherKey="ContentID", IsForeignKey=true)]
		public Content Content
		{
			get
			{
				return this._Content.Entity;
			}
			set
			{
				Content previousValue = this._Content.Entity;
				if (((previousValue != value) 
							|| (this._Content.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Content.Entity = null;
						previousValue.Collection_Geos.Remove(this);
					}
					this._Content.Entity = value;
					if ((value != null))
					{
						value.Collection_Geos.Add(this);
						this._ContentID = value.ContentID;
					}
					else
					{
						this._ContentID = default(Nullable<int>);
					}
					this.SendPropertyChanged("Content");
				}
			}
		}
		
		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));
			}
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Map")]
	public partial class Map : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _MapID;
		
		private string _Name;
		
		private string _Comment;
		
		private System.Nullable<short> _OrgProductionStartYear;
		
		private System.Nullable<short> _OrgProductionEndYear;
		
		private bool _IsPublic;
		
		private int _ReplacedBy;
		
		private System.Nullable<int> _ContentID;
		
		private System.Nullable<decimal> _MinLat;
		
		private System.Nullable<decimal> _MaxLat;
		
		private System.Nullable<decimal> _MinLon;
		
		private System.Nullable<decimal> _MaxLon;
		
		private System.Nullable<byte> _MinZ;
		
		private System.Nullable<byte> _MaxZ;
		
		private string _IconCoords;
		
		private int _UserID;
		
		private System.Nullable<int> _LicensTagID;
		
		private string _Licensee;
		
		private string _Source;
		
		private string _About;
		
		private EntitySet<Theme> _Themes;
		
		private EntityRef<Tag> _Tag;
		
		private EntityRef<User> _User;
		
		private EntityRef<Content> _Content;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnMapIDChanging(int value);
    partial void OnMapIDChanged();
    partial void OnNameChanging(string value);
    partial void OnNameChanged();
    partial void OnCommentChanging(string value);
    partial void OnCommentChanged();
    partial void OnOrgProductionStartYearChanging(System.Nullable<short> value);
    partial void OnOrgProductionStartYearChanged();
    partial void OnOrgProductionEndYearChanging(System.Nullable<short> value);
    partial void OnOrgProductionEndYearChanged();
    partial void OnIsPublicChanging(bool value);
    partial void OnIsPublicChanged();
    partial void OnReplacedByChanging(int value);
    partial void OnReplacedByChanged();
    partial void OnContentIDChanging(System.Nullable<int> value);
    partial void OnContentIDChanged();
    partial void OnMinLatChanging(System.Nullable<decimal> value);
    partial void OnMinLatChanged();
    partial void OnMaxLatChanging(System.Nullable<decimal> value);
    partial void OnMaxLatChanged();
    partial void OnMinLonChanging(System.Nullable<decimal> value);
    partial void OnMinLonChanged();
    partial void OnMaxLonChanging(System.Nullable<decimal> value);
    partial void OnMaxLonChanged();
    partial void OnMinZChanging(System.Nullable<byte> value);
    partial void OnMinZChanged();
    partial void OnMaxZChanging(System.Nullable<byte> value);
    partial void OnMaxZChanged();
    partial void OnIconCoordsChanging(string value);
    partial void OnIconCoordsChanged();
    partial void OnUserIDChanging(int value);
    partial void OnUserIDChanged();
    partial void OnLicensTagIDChanging(System.Nullable<int> value);
    partial void OnLicensTagIDChanged();
    partial void OnLicenseeChanging(string value);
    partial void OnLicenseeChanged();
    partial void OnSourceChanging(string value);
    partial void OnSourceChanged();
    partial void OnAboutChanging(string value);
    partial void OnAboutChanged();
    #endregion
		
		public Map()
		{
			this._Themes = new EntitySet<Theme>(new Action<Theme>(this.attach_Themes), new Action<Theme>(this.detach_Themes));
			this._Tag = default(EntityRef<Tag>);
			this._User = default(EntityRef<User>);
			this._Content = default(EntityRef<Content>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MapID", DbType="Int NOT NULL", IsPrimaryKey=true)]
		public int MapID
		{
			get
			{
				return this._MapID;
			}
			set
			{
				if ((this._MapID != value))
				{
					this.OnMapIDChanging(value);
					this.SendPropertyChanging();
					this._MapID = value;
					this.SendPropertyChanged("MapID");
					this.OnMapIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="VarChar(50) NOT NULL", CanBeNull=false)]
		public string Name
		{
			get
			{
				return this._Name;
			}
			set
			{
				if ((this._Name != value))
				{
					this.OnNameChanging(value);
					this.SendPropertyChanging();
					this._Name = value;
					this.SendPropertyChanged("Name");
					this.OnNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Comment", DbType="Text", UpdateCheck=UpdateCheck.Never)]
		public string Comment
		{
			get
			{
				return this._Comment;
			}
			set
			{
				if ((this._Comment != value))
				{
					this.OnCommentChanging(value);
					this.SendPropertyChanging();
					this._Comment = value;
					this.SendPropertyChanged("Comment");
					this.OnCommentChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OrgProductionStartYear", DbType="SmallInt")]
		public System.Nullable<short> OrgProductionStartYear
		{
			get
			{
				return this._OrgProductionStartYear;
			}
			set
			{
				if ((this._OrgProductionStartYear != value))
				{
					this.OnOrgProductionStartYearChanging(value);
					this.SendPropertyChanging();
					this._OrgProductionStartYear = value;
					this.SendPropertyChanged("OrgProductionStartYear");
					this.OnOrgProductionStartYearChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OrgProductionEndYear", DbType="SmallInt")]
		public System.Nullable<short> OrgProductionEndYear
		{
			get
			{
				return this._OrgProductionEndYear;
			}
			set
			{
				if ((this._OrgProductionEndYear != value))
				{
					this.OnOrgProductionEndYearChanging(value);
					this.SendPropertyChanging();
					this._OrgProductionEndYear = value;
					this.SendPropertyChanged("OrgProductionEndYear");
					this.OnOrgProductionEndYearChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsPublic", DbType="Bit NOT NULL")]
		public bool IsPublic
		{
			get
			{
				return this._IsPublic;
			}
			set
			{
				if ((this._IsPublic != value))
				{
					this.OnIsPublicChanging(value);
					this.SendPropertyChanging();
					this._IsPublic = value;
					this.SendPropertyChanged("IsPublic");
					this.OnIsPublicChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ReplacedBy", DbType="Int NOT NULL")]
		public int ReplacedBy
		{
			get
			{
				return this._ReplacedBy;
			}
			set
			{
				if ((this._ReplacedBy != value))
				{
					this.OnReplacedByChanging(value);
					this.SendPropertyChanging();
					this._ReplacedBy = value;
					this.SendPropertyChanged("ReplacedBy");
					this.OnReplacedByChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContentID", DbType="Int")]
		public System.Nullable<int> ContentID
		{
			get
			{
				return this._ContentID;
			}
			set
			{
				if ((this._ContentID != value))
				{
					if (this._Content.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnContentIDChanging(value);
					this.SendPropertyChanging();
					this._ContentID = value;
					this.SendPropertyChanged("ContentID");
					this.OnContentIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MinLat", DbType="Decimal(11,8)")]
		public System.Nullable<decimal> MinLat
		{
			get
			{
				return this._MinLat;
			}
			set
			{
				if ((this._MinLat != value))
				{
					this.OnMinLatChanging(value);
					this.SendPropertyChanging();
					this._MinLat = value;
					this.SendPropertyChanged("MinLat");
					this.OnMinLatChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaxLat", DbType="Decimal(11,8)")]
		public System.Nullable<decimal> MaxLat
		{
			get
			{
				return this._MaxLat;
			}
			set
			{
				if ((this._MaxLat != value))
				{
					this.OnMaxLatChanging(value);
					this.SendPropertyChanging();
					this._MaxLat = value;
					this.SendPropertyChanged("MaxLat");
					this.OnMaxLatChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MinLon", DbType="Decimal(11,8)")]
		public System.Nullable<decimal> MinLon
		{
			get
			{
				return this._MinLon;
			}
			set
			{
				if ((this._MinLon != value))
				{
					this.OnMinLonChanging(value);
					this.SendPropertyChanging();
					this._MinLon = value;
					this.SendPropertyChanged("MinLon");
					this.OnMinLonChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaxLon", DbType="Decimal(11,8)")]
		public System.Nullable<decimal> MaxLon
		{
			get
			{
				return this._MaxLon;
			}
			set
			{
				if ((this._MaxLon != value))
				{
					this.OnMaxLonChanging(value);
					this.SendPropertyChanging();
					this._MaxLon = value;
					this.SendPropertyChanged("MaxLon");
					this.OnMaxLonChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MinZ", DbType="TinyInt")]
		public System.Nullable<byte> MinZ
		{
			get
			{
				return this._MinZ;
			}
			set
			{
				if ((this._MinZ != value))
				{
					this.OnMinZChanging(value);
					this.SendPropertyChanging();
					this._MinZ = value;
					this.SendPropertyChanged("MinZ");
					this.OnMinZChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaxZ", DbType="TinyInt")]
		public System.Nullable<byte> MaxZ
		{
			get
			{
				return this._MaxZ;
			}
			set
			{
				if ((this._MaxZ != value))
				{
					this.OnMaxZChanging(value);
					this.SendPropertyChanging();
					this._MaxZ = value;
					this.SendPropertyChanged("MaxZ");
					this.OnMaxZChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IconCoords", DbType="VarChar(20)")]
		public string IconCoords
		{
			get
			{
				return this._IconCoords;
			}
			set
			{
				if ((this._IconCoords != value))
				{
					this.OnIconCoordsChanging(value);
					this.SendPropertyChanging();
					this._IconCoords = value;
					this.SendPropertyChanged("IconCoords");
					this.OnIconCoordsChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserID", DbType="Int NOT NULL")]
		public int UserID
		{
			get
			{
				return this._UserID;
			}
			set
			{
				if ((this._UserID != value))
				{
					if (this._User.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnUserIDChanging(value);
					this.SendPropertyChanging();
					this._UserID = value;
					this.SendPropertyChanged("UserID");
					this.OnUserIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LicensTagID", DbType="Int")]
		public System.Nullable<int> LicensTagID
		{
			get
			{
				return this._LicensTagID;
			}
			set
			{
				if ((this._LicensTagID != value))
				{
					if (this._Tag.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnLicensTagIDChanging(value);
					this.SendPropertyChanging();
					this._LicensTagID = value;
					this.SendPropertyChanged("LicensTagID");
					this.OnLicensTagIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Licensee", DbType="VarChar(100)")]
		public string Licensee
		{
			get
			{
				return this._Licensee;
			}
			set
			{
				if ((this._Licensee != value))
				{
					this.OnLicenseeChanging(value);
					this.SendPropertyChanging();
					this._Licensee = value;
					this.SendPropertyChanged("Licensee");
					this.OnLicenseeChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Source", DbType="VarChar(100)")]
		public string Source
		{
			get
			{
				return this._Source;
			}
			set
			{
				if ((this._Source != value))
				{
					this.OnSourceChanging(value);
					this.SendPropertyChanging();
					this._Source = value;
					this.SendPropertyChanged("Source");
					this.OnSourceChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_About", DbType="VarChar(100)")]
		public string About
		{
			get
			{
				return this._About;
			}
			set
			{
				if ((this._About != value))
				{
					this.OnAboutChanging(value);
					this.SendPropertyChanging();
					this._About = value;
					this.SendPropertyChanged("About");
					this.OnAboutChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Map_Theme", Storage="_Themes", ThisKey="MapID", OtherKey="MapID")]
		public EntitySet<Theme> Themes
		{
			get
			{
				return this._Themes;
			}
			set
			{
				this._Themes.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Tag_Map", Storage="_Tag", ThisKey="LicensTagID", OtherKey="TagID", IsForeignKey=true)]
		public Tag Tag
		{
			get
			{
				return this._Tag.Entity;
			}
			set
			{
				Tag previousValue = this._Tag.Entity;
				if (((previousValue != value) 
							|| (this._Tag.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Tag.Entity = null;
						previousValue.Maps.Remove(this);
					}
					this._Tag.Entity = value;
					if ((value != null))
					{
						value.Maps.Add(this);
						this._LicensTagID = value.TagID;
					}
					else
					{
						this._LicensTagID = default(Nullable<int>);
					}
					this.SendPropertyChanged("Tag");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_Map", Storage="_User", ThisKey="UserID", OtherKey="UserID", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]
		public User User
		{
			get
			{
				return this._User.Entity;
			}
			set
			{
				User previousValue = this._User.Entity;
				if (((previousValue != value) 
							|| (this._User.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._User.Entity = null;
						previousValue.Maps.Remove(this);
					}
					this._User.Entity = value;
					if ((value != null))
					{
						value.Maps.Add(this);
						this._UserID = value.UserID;
					}
					else
					{
						this._UserID = default(int);
					}
					this.SendPropertyChanged("User");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Content_Map", Storage="_Content", ThisKey="ContentID", OtherKey="ContentID", IsForeignKey=true)]
		public Content Content
		{
			get
			{
				return this._Content.Entity;
			}
			set
			{
				Content previousValue = this._Content.Entity;
				if (((previousValue != value) 
							|| (this._Content.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Content.Entity = null;
						previousValue.Maps.Remove(this);
					}
					this._Content.Entity = value;
					if ((value != null))
					{
						value.Maps.Add(this);
						this._ContentID = value.ContentID;
					}
					else
					{
						this._ContentID = default(Nullable<int>);
					}
					this.SendPropertyChanged("Content");
				}
			}
		}
		
		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));
			}
		}
		
		private void attach_Themes(Theme entity)
		{
			this.SendPropertyChanging();
			entity.Map = this;
		}
		
		private void detach_Themes(Theme entity)
		{
			this.SendPropertyChanging();
			entity.Map = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.PDF")]
	public partial class PDF : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _PDFID;
		
		private string _Title;
		
		private string _Filename;
		
		private int _Ordering;
		
		private int _ContentID;
		
		private int _UserID;
		
		private System.DateTime _Created;
		
		private System.Nullable<System.DateTime> _Deleted;
		
		private EntityRef<User> _User;
		
		private EntityRef<Content> _Content;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnPDFIDChanging(int value);
    partial void OnPDFIDChanged();
    partial void OnTitleChanging(string value);
    partial void OnTitleChanged();
    partial void OnFilenameChanging(string value);
    partial void OnFilenameChanged();
    partial void OnOrderingChanging(int value);
    partial void OnOrderingChanged();
    partial void OnContentIDChanging(int value);
    partial void OnContentIDChanged();
    partial void OnUserIDChanging(int value);
    partial void OnUserIDChanged();
    partial void OnCreatedChanging(System.DateTime value);
    partial void OnCreatedChanged();
    partial void OnDeletedChanging(System.Nullable<System.DateTime> value);
    partial void OnDeletedChanged();
    #endregion
		
		public PDF()
		{
			this._User = default(EntityRef<User>);
			this._Content = default(EntityRef<Content>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PDFID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int PDFID
		{
			get
			{
				return this._PDFID;
			}
			set
			{
				if ((this._PDFID != value))
				{
					this.OnPDFIDChanging(value);
					this.SendPropertyChanging();
					this._PDFID = value;
					this.SendPropertyChanged("PDFID");
					this.OnPDFIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Title", DbType="VarChar(255) NOT NULL", CanBeNull=false)]
		public string Title
		{
			get
			{
				return this._Title;
			}
			set
			{
				if ((this._Title != value))
				{
					this.OnTitleChanging(value);
					this.SendPropertyChanging();
					this._Title = value;
					this.SendPropertyChanged("Title");
					this.OnTitleChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Filename", DbType="VarChar(255) NOT NULL", CanBeNull=false)]
		public string Filename
		{
			get
			{
				return this._Filename;
			}
			set
			{
				if ((this._Filename != value))
				{
					this.OnFilenameChanging(value);
					this.SendPropertyChanging();
					this._Filename = value;
					this.SendPropertyChanged("Filename");
					this.OnFilenameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Ordering", DbType="Int NOT NULL")]
		public int Ordering
		{
			get
			{
				return this._Ordering;
			}
			set
			{
				if ((this._Ordering != value))
				{
					this.OnOrderingChanging(value);
					this.SendPropertyChanging();
					this._Ordering = value;
					this.SendPropertyChanged("Ordering");
					this.OnOrderingChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContentID", DbType="Int NOT NULL")]
		public int ContentID
		{
			get
			{
				return this._ContentID;
			}
			set
			{
				if ((this._ContentID != value))
				{
					if (this._Content.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnContentIDChanging(value);
					this.SendPropertyChanging();
					this._ContentID = value;
					this.SendPropertyChanged("ContentID");
					this.OnContentIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserID", DbType="Int NOT NULL")]
		public int UserID
		{
			get
			{
				return this._UserID;
			}
			set
			{
				if ((this._UserID != value))
				{
					if (this._User.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnUserIDChanging(value);
					this.SendPropertyChanging();
					this._UserID = value;
					this.SendPropertyChanged("UserID");
					this.OnUserIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Created", DbType="DateTime NOT NULL")]
		public System.DateTime Created
		{
			get
			{
				return this._Created;
			}
			set
			{
				if ((this._Created != value))
				{
					this.OnCreatedChanging(value);
					this.SendPropertyChanging();
					this._Created = value;
					this.SendPropertyChanged("Created");
					this.OnCreatedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Deleted", DbType="DateTime")]
		public System.Nullable<System.DateTime> Deleted
		{
			get
			{
				return this._Deleted;
			}
			set
			{
				if ((this._Deleted != value))
				{
					this.OnDeletedChanging(value);
					this.SendPropertyChanging();
					this._Deleted = value;
					this.SendPropertyChanged("Deleted");
					this.OnDeletedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_PDF", Storage="_User", ThisKey="UserID", OtherKey="UserID", IsForeignKey=true)]
		public User User
		{
			get
			{
				return this._User.Entity;
			}
			set
			{
				User previousValue = this._User.Entity;
				if (((previousValue != value) 
							|| (this._User.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._User.Entity = null;
						previousValue.PDFs.Remove(this);
					}
					this._User.Entity = value;
					if ((value != null))
					{
						value.PDFs.Add(this);
						this._UserID = value.UserID;
					}
					else
					{
						this._UserID = default(int);
					}
					this.SendPropertyChanged("User");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Content_PDF", Storage="_Content", ThisKey="ContentID", OtherKey="ContentID", IsForeignKey=true)]
		public Content Content
		{
			get
			{
				return this._Content.Entity;
			}
			set
			{
				Content previousValue = this._Content.Entity;
				if (((previousValue != value) 
							|| (this._Content.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Content.Entity = null;
						previousValue.PDFs.Remove(this);
					}
					this._Content.Entity = value;
					if ((value != null))
					{
						value.PDFs.Add(this);
						this._ContentID = value.ContentID;
					}
					else
					{
						this._ContentID = default(int);
					}
					this.SendPropertyChanged("Content");
				}
			}
		}
		
		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));
			}
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Content")]
	public partial class Content : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _ContentID;
		
		private string _Headline;
		
		private System.Nullable<int> _GeoID;
		
		private short _Ordering;
		
		private byte _ContentTypeID;
		
		private System.Nullable<System.DateTime> _Deleted;
		
		private int _UserID;
		
		private System.DateTime _Created;
		
		private EntitySet<Tag_Content> _Tag_Contents;
		
		private EntitySet<Theme> _Themes;
		
		private EntitySet<Tag> _Tags;
		
		private EntitySet<Collection> _Collections;
		
		private EntitySet<Collection_Geo> _Collection_Geos;
		
		private EntitySet<Map> _Maps;
		
		private EntitySet<PDF> _PDFs;
		
		private EntitySet<Biblio> _Biblios;
		
		private EntitySet<Institution> _Institutions;
		
		private EntitySet<ExternalContent> _ExternalContents;
		
		private EntitySet<Text> _Texts;
		
		private EntityRef<ContentType> _ContentType;
		
		private EntityRef<Geo> _Geo;
		
		private EntityRef<User> _User;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnContentIDChanging(int value);
    partial void OnContentIDChanged();
    partial void OnHeadlineChanging(string value);
    partial void OnHeadlineChanged();
    partial void OnGeoIDChanging(System.Nullable<int> value);
    partial void OnGeoIDChanged();
    partial void OnOrderingChanging(short value);
    partial void OnOrderingChanged();
    partial void OnContentTypeIDChanging(byte value);
    partial void OnContentTypeIDChanged();
    partial void OnDeletedChanging(System.Nullable<System.DateTime> value);
    partial void OnDeletedChanged();
    partial void OnUserIDChanging(int value);
    partial void OnUserIDChanged();
    partial void OnCreatedChanging(System.DateTime value);
    partial void OnCreatedChanged();
    #endregion
		
		public Content()
		{
			this._Tag_Contents = new EntitySet<Tag_Content>(new Action<Tag_Content>(this.attach_Tag_Contents), new Action<Tag_Content>(this.detach_Tag_Contents));
			this._Themes = new EntitySet<Theme>(new Action<Theme>(this.attach_Themes), new Action<Theme>(this.detach_Themes));
			this._Tags = new EntitySet<Tag>(new Action<Tag>(this.attach_Tags), new Action<Tag>(this.detach_Tags));
			this._Collections = new EntitySet<Collection>(new Action<Collection>(this.attach_Collections), new Action<Collection>(this.detach_Collections));
			this._Collection_Geos = new EntitySet<Collection_Geo>(new Action<Collection_Geo>(this.attach_Collection_Geos), new Action<Collection_Geo>(this.detach_Collection_Geos));
			this._Maps = new EntitySet<Map>(new Action<Map>(this.attach_Maps), new Action<Map>(this.detach_Maps));
			this._PDFs = new EntitySet<PDF>(new Action<PDF>(this.attach_PDFs), new Action<PDF>(this.detach_PDFs));
			this._Biblios = new EntitySet<Biblio>(new Action<Biblio>(this.attach_Biblios), new Action<Biblio>(this.detach_Biblios));
			this._Institutions = new EntitySet<Institution>(new Action<Institution>(this.attach_Institutions), new Action<Institution>(this.detach_Institutions));
			this._ExternalContents = new EntitySet<ExternalContent>(new Action<ExternalContent>(this.attach_ExternalContents), new Action<ExternalContent>(this.detach_ExternalContents));
			this._Texts = new EntitySet<Text>(new Action<Text>(this.attach_Texts), new Action<Text>(this.detach_Texts));
			this._ContentType = default(EntityRef<ContentType>);
			this._Geo = default(EntityRef<Geo>);
			this._User = default(EntityRef<User>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContentID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int ContentID
		{
			get
			{
				return this._ContentID;
			}
			set
			{
				if ((this._ContentID != value))
				{
					this.OnContentIDChanging(value);
					this.SendPropertyChanging();
					this._ContentID = value;
					this.SendPropertyChanged("ContentID");
					this.OnContentIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Headline", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
		public string Headline
		{
			get
			{
				return this._Headline;
			}
			set
			{
				if ((this._Headline != value))
				{
					this.OnHeadlineChanging(value);
					this.SendPropertyChanging();
					this._Headline = value;
					this.SendPropertyChanged("Headline");
					this.OnHeadlineChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GeoID", DbType="Int")]
		public System.Nullable<int> GeoID
		{
			get
			{
				return this._GeoID;
			}
			set
			{
				if ((this._GeoID != value))
				{
					if (this._Geo.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnGeoIDChanging(value);
					this.SendPropertyChanging();
					this._GeoID = value;
					this.SendPropertyChanged("GeoID");
					this.OnGeoIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Ordering", DbType="SmallInt NOT NULL")]
		public short Ordering
		{
			get
			{
				return this._Ordering;
			}
			set
			{
				if ((this._Ordering != value))
				{
					this.OnOrderingChanging(value);
					this.SendPropertyChanging();
					this._Ordering = value;
					this.SendPropertyChanged("Ordering");
					this.OnOrderingChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContentTypeID", DbType="TinyInt NOT NULL")]
		public byte ContentTypeID
		{
			get
			{
				return this._ContentTypeID;
			}
			set
			{
				if ((this._ContentTypeID != value))
				{
					if (this._ContentType.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnContentTypeIDChanging(value);
					this.SendPropertyChanging();
					this._ContentTypeID = value;
					this.SendPropertyChanged("ContentTypeID");
					this.OnContentTypeIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Deleted", DbType="DateTime")]
		public System.Nullable<System.DateTime> Deleted
		{
			get
			{
				return this._Deleted;
			}
			set
			{
				if ((this._Deleted != value))
				{
					this.OnDeletedChanging(value);
					this.SendPropertyChanging();
					this._Deleted = value;
					this.SendPropertyChanged("Deleted");
					this.OnDeletedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserID", DbType="Int NOT NULL")]
		public int UserID
		{
			get
			{
				return this._UserID;
			}
			set
			{
				if ((this._UserID != value))
				{
					if (this._User.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnUserIDChanging(value);
					this.SendPropertyChanging();
					this._UserID = value;
					this.SendPropertyChanged("UserID");
					this.OnUserIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Created", DbType="DateTime NOT NULL")]
		public System.DateTime Created
		{
			get
			{
				return this._Created;
			}
			set
			{
				if ((this._Created != value))
				{
					this.OnCreatedChanging(value);
					this.SendPropertyChanging();
					this._Created = value;
					this.SendPropertyChanged("Created");
					this.OnCreatedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Content_Tag_Content", Storage="_Tag_Contents", ThisKey="ContentID", OtherKey="ContentID")]
		public EntitySet<Tag_Content> Tag_Contents
		{
			get
			{
				return this._Tag_Contents;
			}
			set
			{
				this._Tag_Contents.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Content_Theme", Storage="_Themes", ThisKey="ContentID", OtherKey="ContentID")]
		public EntitySet<Theme> Themes
		{
			get
			{
				return this._Themes;
			}
			set
			{
				this._Themes.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Content_Tag", Storage="_Tags", ThisKey="ContentID", OtherKey="ContentID")]
		public EntitySet<Tag> Tags
		{
			get
			{
				return this._Tags;
			}
			set
			{
				this._Tags.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Content_Collection", Storage="_Collections", ThisKey="ContentID", OtherKey="ContentID")]
		public EntitySet<Collection> Collections
		{
			get
			{
				return this._Collections;
			}
			set
			{
				this._Collections.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Content_Collection_Geo", Storage="_Collection_Geos", ThisKey="ContentID", OtherKey="ContentID")]
		public EntitySet<Collection_Geo> Collection_Geos
		{
			get
			{
				return this._Collection_Geos;
			}
			set
			{
				this._Collection_Geos.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Content_Map", Storage="_Maps", ThisKey="ContentID", OtherKey="ContentID")]
		public EntitySet<Map> Maps
		{
			get
			{
				return this._Maps;
			}
			set
			{
				this._Maps.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Content_PDF", Storage="_PDFs", ThisKey="ContentID", OtherKey="ContentID")]
		public EntitySet<PDF> PDFs
		{
			get
			{
				return this._PDFs;
			}
			set
			{
				this._PDFs.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Content_Biblio", Storage="_Biblios", ThisKey="ContentID", OtherKey="ContentID")]
		public EntitySet<Biblio> Biblios
		{
			get
			{
				return this._Biblios;
			}
			set
			{
				this._Biblios.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Content_Institution", Storage="_Institutions", ThisKey="ContentID", OtherKey="ContentID")]
		public EntitySet<Institution> Institutions
		{
			get
			{
				return this._Institutions;
			}
			set
			{
				this._Institutions.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Content_ExternalContent", Storage="_ExternalContents", ThisKey="ContentID", OtherKey="ContentID")]
		public EntitySet<ExternalContent> ExternalContents
		{
			get
			{
				return this._ExternalContents;
			}
			set
			{
				this._ExternalContents.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Content_Text", Storage="_Texts", ThisKey="ContentID", OtherKey="ContentID")]
		public EntitySet<Text> Texts
		{
			get
			{
				return this._Texts;
			}
			set
			{
				this._Texts.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="ContentType_Content", Storage="_ContentType", ThisKey="ContentTypeID", OtherKey="ContentTypeID", IsForeignKey=true)]
		public ContentType ContentType
		{
			get
			{
				return this._ContentType.Entity;
			}
			set
			{
				ContentType previousValue = this._ContentType.Entity;
				if (((previousValue != value) 
							|| (this._ContentType.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._ContentType.Entity = null;
						previousValue.Contents.Remove(this);
					}
					this._ContentType.Entity = value;
					if ((value != null))
					{
						value.Contents.Add(this);
						this._ContentTypeID = value.ContentTypeID;
					}
					else
					{
						this._ContentTypeID = default(byte);
					}
					this.SendPropertyChanged("ContentType");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Geo_Content", Storage="_Geo", ThisKey="GeoID", OtherKey="GeoID", IsForeignKey=true)]
		public Geo Geo
		{
			get
			{
				return this._Geo.Entity;
			}
			set
			{
				Geo previousValue = this._Geo.Entity;
				if (((previousValue != value) 
							|| (this._Geo.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Geo.Entity = null;
						previousValue.Contents.Remove(this);
					}
					this._Geo.Entity = value;
					if ((value != null))
					{
						value.Contents.Add(this);
						this._GeoID = value.GeoID;
					}
					else
					{
						this._GeoID = default(Nullable<int>);
					}
					this.SendPropertyChanged("Geo");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_Content", Storage="_User", ThisKey="UserID", OtherKey="UserID", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]
		public User User
		{
			get
			{
				return this._User.Entity;
			}
			set
			{
				User previousValue = this._User.Entity;
				if (((previousValue != value) 
							|| (this._User.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._User.Entity = null;
						previousValue.Contents.Remove(this);
					}
					this._User.Entity = value;
					if ((value != null))
					{
						value.Contents.Add(this);
						this._UserID = value.UserID;
					}
					else
					{
						this._UserID = default(int);
					}
					this.SendPropertyChanged("User");
				}
			}
		}
		
		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));
			}
		}
		
		private void attach_Tag_Contents(Tag_Content entity)
		{
			this.SendPropertyChanging();
			entity.Content = this;
		}
		
		private void detach_Tag_Contents(Tag_Content entity)
		{
			this.SendPropertyChanging();
			entity.Content = null;
		}
		
		private void attach_Themes(Theme entity)
		{
			this.SendPropertyChanging();
			entity.Content = this;
		}
		
		private void detach_Themes(Theme entity)
		{
			this.SendPropertyChanging();
			entity.Content = null;
		}
		
		private void attach_Tags(Tag entity)
		{
			this.SendPropertyChanging();
			entity.Content = this;
		}
		
		private void detach_Tags(Tag entity)
		{
			this.SendPropertyChanging();
			entity.Content = null;
		}
		
		private void attach_Collections(Collection entity)
		{
			this.SendPropertyChanging();
			entity.Content = this;
		}
		
		private void detach_Collections(Collection entity)
		{
			this.SendPropertyChanging();
			entity.Content = null;
		}
		
		private void attach_Collection_Geos(Collection_Geo entity)
		{
			this.SendPropertyChanging();
			entity.Content = this;
		}
		
		private void detach_Collection_Geos(Collection_Geo entity)
		{
			this.SendPropertyChanging();
			entity.Content = null;
		}
		
		private void attach_Maps(Map entity)
		{
			this.SendPropertyChanging();
			entity.Content = this;
		}
		
		private void detach_Maps(Map entity)
		{
			this.SendPropertyChanging();
			entity.Content = null;
		}
		
		private void attach_PDFs(PDF entity)
		{
			this.SendPropertyChanging();
			entity.Content = this;
		}
		
		private void detach_PDFs(PDF entity)
		{
			this.SendPropertyChanging();
			entity.Content = null;
		}
		
		private void attach_Biblios(Biblio entity)
		{
			this.SendPropertyChanging();
			entity.Content = this;
		}
		
		private void detach_Biblios(Biblio entity)
		{
			this.SendPropertyChanging();
			entity.Content = null;
		}
		
		private void attach_Institutions(Institution entity)
		{
			this.SendPropertyChanging();
			entity.Content = this;
		}
		
		private void detach_Institutions(Institution entity)
		{
			this.SendPropertyChanging();
			entity.Content = null;
		}
		
		private void attach_ExternalContents(ExternalContent entity)
		{
			this.SendPropertyChanging();
			entity.Content = this;
		}
		
		private void detach_ExternalContents(ExternalContent entity)
		{
			this.SendPropertyChanging();
			entity.Content = null;
		}
		
		private void attach_Texts(Text entity)
		{
			this.SendPropertyChanging();
			entity.Content = this;
		}
		
		private void detach_Texts(Text entity)
		{
			this.SendPropertyChanging();
			entity.Content = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Biblio")]
	public partial class Biblio : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _BiblioID;
		
		private string _CQL;
		
		private string _Ordering;
		
		private int _ContentID;
		
		private int _UserID;
		
		private System.DateTime _Created;
		
		private System.Nullable<System.DateTime> _Deleted;
		
		private EntityRef<Content> _Content;
		
		private EntityRef<User> _User;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnBiblioIDChanging(int value);
    partial void OnBiblioIDChanged();
    partial void OnCQLChanging(string value);
    partial void OnCQLChanged();
    partial void OnOrderingChanging(string value);
    partial void OnOrderingChanged();
    partial void OnContentIDChanging(int value);
    partial void OnContentIDChanged();
    partial void OnUserIDChanging(int value);
    partial void OnUserIDChanged();
    partial void OnCreatedChanging(System.DateTime value);
    partial void OnCreatedChanged();
    partial void OnDeletedChanging(System.Nullable<System.DateTime> value);
    partial void OnDeletedChanged();
    #endregion
		
		public Biblio()
		{
			this._Content = default(EntityRef<Content>);
			this._User = default(EntityRef<User>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BiblioID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int BiblioID
		{
			get
			{
				return this._BiblioID;
			}
			set
			{
				if ((this._BiblioID != value))
				{
					this.OnBiblioIDChanging(value);
					this.SendPropertyChanging();
					this._BiblioID = value;
					this.SendPropertyChanged("BiblioID");
					this.OnBiblioIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CQL", DbType="VarChar(512) NOT NULL", CanBeNull=false)]
		public string CQL
		{
			get
			{
				return this._CQL;
			}
			set
			{
				if ((this._CQL != value))
				{
					this.OnCQLChanging(value);
					this.SendPropertyChanging();
					this._CQL = value;
					this.SendPropertyChanged("CQL");
					this.OnCQLChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Ordering", DbType="NChar(10) NOT NULL", CanBeNull=false)]
		public string Ordering
		{
			get
			{
				return this._Ordering;
			}
			set
			{
				if ((this._Ordering != value))
				{
					this.OnOrderingChanging(value);
					this.SendPropertyChanging();
					this._Ordering = value;
					this.SendPropertyChanged("Ordering");
					this.OnOrderingChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContentID", DbType="Int NOT NULL")]
		public int ContentID
		{
			get
			{
				return this._ContentID;
			}
			set
			{
				if ((this._ContentID != value))
				{
					if (this._Content.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnContentIDChanging(value);
					this.SendPropertyChanging();
					this._ContentID = value;
					this.SendPropertyChanged("ContentID");
					this.OnContentIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserID", DbType="Int NOT NULL")]
		public int UserID
		{
			get
			{
				return this._UserID;
			}
			set
			{
				if ((this._UserID != value))
				{
					if (this._User.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnUserIDChanging(value);
					this.SendPropertyChanging();
					this._UserID = value;
					this.SendPropertyChanged("UserID");
					this.OnUserIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Created", DbType="DateTime NOT NULL")]
		public System.DateTime Created
		{
			get
			{
				return this._Created;
			}
			set
			{
				if ((this._Created != value))
				{
					this.OnCreatedChanging(value);
					this.SendPropertyChanging();
					this._Created = value;
					this.SendPropertyChanged("Created");
					this.OnCreatedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Deleted", DbType="DateTime")]
		public System.Nullable<System.DateTime> Deleted
		{
			get
			{
				return this._Deleted;
			}
			set
			{
				if ((this._Deleted != value))
				{
					this.OnDeletedChanging(value);
					this.SendPropertyChanging();
					this._Deleted = value;
					this.SendPropertyChanged("Deleted");
					this.OnDeletedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Content_Biblio", Storage="_Content", ThisKey="ContentID", OtherKey="ContentID", IsForeignKey=true)]
		public Content Content
		{
			get
			{
				return this._Content.Entity;
			}
			set
			{
				Content previousValue = this._Content.Entity;
				if (((previousValue != value) 
							|| (this._Content.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Content.Entity = null;
						previousValue.Biblios.Remove(this);
					}
					this._Content.Entity = value;
					if ((value != null))
					{
						value.Biblios.Add(this);
						this._ContentID = value.ContentID;
					}
					else
					{
						this._ContentID = default(int);
					}
					this.SendPropertyChanged("Content");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_Biblio", Storage="_User", ThisKey="UserID", OtherKey="UserID", IsForeignKey=true)]
		public User User
		{
			get
			{
				return this._User.Entity;
			}
			set
			{
				User previousValue = this._User.Entity;
				if (((previousValue != value) 
							|| (this._User.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._User.Entity = null;
						previousValue.Biblios.Remove(this);
					}
					this._User.Entity = value;
					if ((value != null))
					{
						value.Biblios.Add(this);
						this._UserID = value.UserID;
					}
					else
					{
						this._UserID = default(int);
					}
					this.SendPropertyChanged("User");
				}
			}
		}
		
		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));
			}
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Institution")]
	public partial class Institution : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _InstitutionID;
		
		private string _URL;
		
		private string _Email;
		
		private System.Nullable<byte> _Type;
		
		private System.Nullable<System.DateTime> _Deleted;
		
		private int _TagID;
		
		private System.Nullable<int> _ContentID;
		
		private int _GeoViews;
		
		private EntitySet<User_Institution> _User_Institutions;
		
		private EntityRef<Content> _Content;
		
		private EntityRef<Tag> _Tag;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnInstitutionIDChanging(int value);
    partial void OnInstitutionIDChanged();
    partial void OnURLChanging(string value);
    partial void OnURLChanged();
    partial void OnEmailChanging(string value);
    partial void OnEmailChanged();
    partial void OnTypeChanging(System.Nullable<byte> value);
    partial void OnTypeChanged();
    partial void OnDeletedChanging(System.Nullable<System.DateTime> value);
    partial void OnDeletedChanged();
    partial void OnTagIDChanging(int value);
    partial void OnTagIDChanged();
    partial void OnContentIDChanging(System.Nullable<int> value);
    partial void OnContentIDChanged();
    partial void OnGeoViewsChanging(int value);
    partial void OnGeoViewsChanged();
    #endregion
		
		public Institution()
		{
			this._User_Institutions = new EntitySet<User_Institution>(new Action<User_Institution>(this.attach_User_Institutions), new Action<User_Institution>(this.detach_User_Institutions));
			this._Content = default(EntityRef<Content>);
			this._Tag = default(EntityRef<Tag>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InstitutionID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int InstitutionID
		{
			get
			{
				return this._InstitutionID;
			}
			set
			{
				if ((this._InstitutionID != value))
				{
					this.OnInstitutionIDChanging(value);
					this.SendPropertyChanging();
					this._InstitutionID = value;
					this.SendPropertyChanged("InstitutionID");
					this.OnInstitutionIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_URL", DbType="NVarChar(255) NOT NULL", CanBeNull=false)]
		public string URL
		{
			get
			{
				return this._URL;
			}
			set
			{
				if ((this._URL != value))
				{
					this.OnURLChanging(value);
					this.SendPropertyChanging();
					this._URL = value;
					this.SendPropertyChanged("URL");
					this.OnURLChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Email", DbType="NVarChar(255) NOT NULL", CanBeNull=false)]
		public string Email
		{
			get
			{
				return this._Email;
			}
			set
			{
				if ((this._Email != value))
				{
					this.OnEmailChanging(value);
					this.SendPropertyChanging();
					this._Email = value;
					this.SendPropertyChanged("Email");
					this.OnEmailChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Type", DbType="TinyInt")]
		public System.Nullable<byte> Type
		{
			get
			{
				return this._Type;
			}
			set
			{
				if ((this._Type != value))
				{
					this.OnTypeChanging(value);
					this.SendPropertyChanging();
					this._Type = value;
					this.SendPropertyChanged("Type");
					this.OnTypeChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Deleted", DbType="DateTime")]
		public System.Nullable<System.DateTime> Deleted
		{
			get
			{
				return this._Deleted;
			}
			set
			{
				if ((this._Deleted != value))
				{
					this.OnDeletedChanging(value);
					this.SendPropertyChanging();
					this._Deleted = value;
					this.SendPropertyChanged("Deleted");
					this.OnDeletedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TagID", DbType="Int NOT NULL")]
		public int TagID
		{
			get
			{
				return this._TagID;
			}
			set
			{
				if ((this._TagID != value))
				{
					if (this._Tag.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnTagIDChanging(value);
					this.SendPropertyChanging();
					this._TagID = value;
					this.SendPropertyChanged("TagID");
					this.OnTagIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContentID", DbType="Int")]
		public System.Nullable<int> ContentID
		{
			get
			{
				return this._ContentID;
			}
			set
			{
				if ((this._ContentID != value))
				{
					if (this._Content.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnContentIDChanging(value);
					this.SendPropertyChanging();
					this._ContentID = value;
					this.SendPropertyChanged("ContentID");
					this.OnContentIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GeoViews", DbType="Int NOT NULL")]
		public int GeoViews
		{
			get
			{
				return this._GeoViews;
			}
			set
			{
				if ((this._GeoViews != value))
				{
					this.OnGeoViewsChanging(value);
					this.SendPropertyChanging();
					this._GeoViews = value;
					this.SendPropertyChanged("GeoViews");
					this.OnGeoViewsChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Institution_User_Institution", Storage="_User_Institutions", ThisKey="InstitutionID", OtherKey="InstitutionID")]
		public EntitySet<User_Institution> User_Institutions
		{
			get
			{
				return this._User_Institutions;
			}
			set
			{
				this._User_Institutions.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Content_Institution", Storage="_Content", ThisKey="ContentID", OtherKey="ContentID", IsForeignKey=true)]
		public Content Content
		{
			get
			{
				return this._Content.Entity;
			}
			set
			{
				Content previousValue = this._Content.Entity;
				if (((previousValue != value) 
							|| (this._Content.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Content.Entity = null;
						previousValue.Institutions.Remove(this);
					}
					this._Content.Entity = value;
					if ((value != null))
					{
						value.Institutions.Add(this);
						this._ContentID = value.ContentID;
					}
					else
					{
						this._ContentID = default(Nullable<int>);
					}
					this.SendPropertyChanged("Content");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Tag_Institution", Storage="_Tag", ThisKey="TagID", OtherKey="TagID", IsForeignKey=true)]
		public Tag Tag
		{
			get
			{
				return this._Tag.Entity;
			}
			set
			{
				Tag previousValue = this._Tag.Entity;
				if (((previousValue != value) 
							|| (this._Tag.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Tag.Entity = null;
						previousValue.Institutions.Remove(this);
					}
					this._Tag.Entity = value;
					if ((value != null))
					{
						value.Institutions.Add(this);
						this._TagID = value.TagID;
					}
					else
					{
						this._TagID = default(int);
					}
					this.SendPropertyChanged("Tag");
				}
			}
		}
		
		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));
			}
		}
		
		private void attach_User_Institutions(User_Institution entity)
		{
			this.SendPropertyChanging();
			entity.Institution = this;
		}
		
		private void detach_User_Institutions(User_Institution entity)
		{
			this.SendPropertyChanging();
			entity.Institution = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.ExternalContent")]
	public partial class ExternalContent : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _ExternalContentID;
		
		private int _ContentID;
		
		private byte _ExternalSourceID;
		
		private string _Text;
		
		private string _Link;
		
		private int _UserID;
		
		private System.DateTime _Created;
		
		private System.Nullable<System.DateTime> _Deleted;
		
		private EntityRef<Content> _Content;
		
		private EntityRef<User> _User;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnExternalContentIDChanging(int value);
    partial void OnExternalContentIDChanged();
    partial void OnContentIDChanging(int value);
    partial void OnContentIDChanged();
    partial void OnExternalSourceIDChanging(byte value);
    partial void OnExternalSourceIDChanged();
    partial void OnTextChanging(string value);
    partial void OnTextChanged();
    partial void OnLinkChanging(string value);
    partial void OnLinkChanged();
    partial void OnUserIDChanging(int value);
    partial void OnUserIDChanged();
    partial void OnCreatedChanging(System.DateTime value);
    partial void OnCreatedChanged();
    partial void OnDeletedChanging(System.Nullable<System.DateTime> value);
    partial void OnDeletedChanged();
    #endregion
		
		public ExternalContent()
		{
			this._Content = default(EntityRef<Content>);
			this._User = default(EntityRef<User>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ExternalContentID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int ExternalContentID
		{
			get
			{
				return this._ExternalContentID;
			}
			set
			{
				if ((this._ExternalContentID != value))
				{
					this.OnExternalContentIDChanging(value);
					this.SendPropertyChanging();
					this._ExternalContentID = value;
					this.SendPropertyChanged("ExternalContentID");
					this.OnExternalContentIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContentID", DbType="Int NOT NULL")]
		public int ContentID
		{
			get
			{
				return this._ContentID;
			}
			set
			{
				if ((this._ContentID != value))
				{
					if (this._Content.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnContentIDChanging(value);
					this.SendPropertyChanging();
					this._ContentID = value;
					this.SendPropertyChanged("ContentID");
					this.OnContentIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ExternalSourceID", DbType="TinyInt NOT NULL")]
		public byte ExternalSourceID
		{
			get
			{
				return this._ExternalSourceID;
			}
			set
			{
				if ((this._ExternalSourceID != value))
				{
					this.OnExternalSourceIDChanging(value);
					this.SendPropertyChanging();
					this._ExternalSourceID = value;
					this.SendPropertyChanged("ExternalSourceID");
					this.OnExternalSourceIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Text", DbType="Text NOT NULL", CanBeNull=false, UpdateCheck=UpdateCheck.Never)]
		public string Text
		{
			get
			{
				return this._Text;
			}
			set
			{
				if ((this._Text != value))
				{
					this.OnTextChanging(value);
					this.SendPropertyChanging();
					this._Text = value;
					this.SendPropertyChanged("Text");
					this.OnTextChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Link", DbType="VarChar(255) NOT NULL", CanBeNull=false)]
		public string Link
		{
			get
			{
				return this._Link;
			}
			set
			{
				if ((this._Link != value))
				{
					this.OnLinkChanging(value);
					this.SendPropertyChanging();
					this._Link = value;
					this.SendPropertyChanged("Link");
					this.OnLinkChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserID", DbType="Int NOT NULL")]
		public int UserID
		{
			get
			{
				return this._UserID;
			}
			set
			{
				if ((this._UserID != value))
				{
					if (this._User.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnUserIDChanging(value);
					this.SendPropertyChanging();
					this._UserID = value;
					this.SendPropertyChanged("UserID");
					this.OnUserIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Created", DbType="DateTime NOT NULL")]
		public System.DateTime Created
		{
			get
			{
				return this._Created;
			}
			set
			{
				if ((this._Created != value))
				{
					this.OnCreatedChanging(value);
					this.SendPropertyChanging();
					this._Created = value;
					this.SendPropertyChanged("Created");
					this.OnCreatedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Deleted", DbType="DateTime")]
		public System.Nullable<System.DateTime> Deleted
		{
			get
			{
				return this._Deleted;
			}
			set
			{
				if ((this._Deleted != value))
				{
					this.OnDeletedChanging(value);
					this.SendPropertyChanging();
					this._Deleted = value;
					this.SendPropertyChanged("Deleted");
					this.OnDeletedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Content_ExternalContent", Storage="_Content", ThisKey="ContentID", OtherKey="ContentID", IsForeignKey=true)]
		public Content Content
		{
			get
			{
				return this._Content.Entity;
			}
			set
			{
				Content previousValue = this._Content.Entity;
				if (((previousValue != value) 
							|| (this._Content.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Content.Entity = null;
						previousValue.ExternalContents.Remove(this);
					}
					this._Content.Entity = value;
					if ((value != null))
					{
						value.ExternalContents.Add(this);
						this._ContentID = value.ContentID;
					}
					else
					{
						this._ContentID = default(int);
					}
					this.SendPropertyChanged("Content");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_ExternalContent", Storage="_User", ThisKey="UserID", OtherKey="UserID", IsForeignKey=true)]
		public User User
		{
			get
			{
				return this._User.Entity;
			}
			set
			{
				User previousValue = this._User.Entity;
				if (((previousValue != value) 
							|| (this._User.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._User.Entity = null;
						previousValue.ExternalContents.Remove(this);
					}
					this._User.Entity = value;
					if ((value != null))
					{
						value.ExternalContents.Add(this);
						this._UserID = value.UserID;
					}
					else
					{
						this._UserID = default(int);
					}
					this.SendPropertyChanged("User");
				}
			}
		}
		
		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));
			}
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.User_Institution")]
	public partial class User_Institution : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _UserID;
		
		private int _InstitutionID;
		
		private System.DateTime _Created;
		
		private System.Nullable<System.DateTime> _Deleted;
		
		private EntityRef<Institution> _Institution;
		
		private EntityRef<User> _User;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnUserIDChanging(int value);
    partial void OnUserIDChanged();
    partial void OnInstitutionIDChanging(int value);
    partial void OnInstitutionIDChanged();
    partial void OnCreatedChanging(System.DateTime value);
    partial void OnCreatedChanged();
    partial void OnDeletedChanging(System.Nullable<System.DateTime> value);
    partial void OnDeletedChanged();
    #endregion
		
		public User_Institution()
		{
			this._Institution = default(EntityRef<Institution>);
			this._User = default(EntityRef<User>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserID", DbType="Int NOT NULL", IsPrimaryKey=true)]
		public int UserID
		{
			get
			{
				return this._UserID;
			}
			set
			{
				if ((this._UserID != value))
				{
					if (this._User.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnUserIDChanging(value);
					this.SendPropertyChanging();
					this._UserID = value;
					this.SendPropertyChanged("UserID");
					this.OnUserIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InstitutionID", DbType="Int NOT NULL", IsPrimaryKey=true)]
		public int InstitutionID
		{
			get
			{
				return this._InstitutionID;
			}
			set
			{
				if ((this._InstitutionID != value))
				{
					if (this._Institution.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnInstitutionIDChanging(value);
					this.SendPropertyChanging();
					this._InstitutionID = value;
					this.SendPropertyChanged("InstitutionID");
					this.OnInstitutionIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Created", DbType="DateTime NOT NULL")]
		public System.DateTime Created
		{
			get
			{
				return this._Created;
			}
			set
			{
				if ((this._Created != value))
				{
					this.OnCreatedChanging(value);
					this.SendPropertyChanging();
					this._Created = value;
					this.SendPropertyChanged("Created");
					this.OnCreatedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Deleted", DbType="DateTime")]
		public System.Nullable<System.DateTime> Deleted
		{
			get
			{
				return this._Deleted;
			}
			set
			{
				if ((this._Deleted != value))
				{
					this.OnDeletedChanging(value);
					this.SendPropertyChanging();
					this._Deleted = value;
					this.SendPropertyChanged("Deleted");
					this.OnDeletedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Institution_User_Institution", Storage="_Institution", ThisKey="InstitutionID", OtherKey="InstitutionID", IsForeignKey=true)]
		public Institution Institution
		{
			get
			{
				return this._Institution.Entity;
			}
			set
			{
				Institution previousValue = this._Institution.Entity;
				if (((previousValue != value) 
							|| (this._Institution.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Institution.Entity = null;
						previousValue.User_Institutions.Remove(this);
					}
					this._Institution.Entity = value;
					if ((value != null))
					{
						value.User_Institutions.Add(this);
						this._InstitutionID = value.InstitutionID;
					}
					else
					{
						this._InstitutionID = default(int);
					}
					this.SendPropertyChanged("Institution");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_User_Institution", Storage="_User", ThisKey="UserID", OtherKey="UserID", IsForeignKey=true)]
		public User User
		{
			get
			{
				return this._User.Entity;
			}
			set
			{
				User previousValue = this._User.Entity;
				if (((previousValue != value) 
							|| (this._User.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._User.Entity = null;
						previousValue.User_Institutions.Remove(this);
					}
					this._User.Entity = value;
					if ((value != null))
					{
						value.User_Institutions.Add(this);
						this._UserID = value.UserID;
					}
					else
					{
						this._UserID = default(int);
					}
					this.SendPropertyChanged("User");
				}
			}
		}
		
		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));
			}
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Text")]
	public partial class Text : WSDynamicEntity, INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _TextID;
		
		private string _Text1;
		
		private int _Ordering;
		
		private string _Name;
		
		private byte _Type;
		
		private int _ContentID;
		
		private int _UserID;
		
		private System.DateTime _Created;
		
		private System.Nullable<System.DateTime> _Deleted;
		
		private EntityRef<Content> _Content;
		
		private EntityRef<User> _User;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnTextIDChanging(int value);
    partial void OnTextIDChanged();
    partial void OnText1Changing(string value);
    partial void OnText1Changed();
    partial void OnOrderingChanging(int value);
    partial void OnOrderingChanged();
    partial void OnNameChanging(string value);
    partial void OnNameChanged();
    partial void OnTypeChanging(byte value);
    partial void OnTypeChanged();
    partial void OnContentIDChanging(int value);
    partial void OnContentIDChanged();
    partial void OnUserIDChanging(int value);
    partial void OnUserIDChanged();
    partial void OnCreatedChanging(System.DateTime value);
    partial void OnCreatedChanged();
    partial void OnDeletedChanging(System.Nullable<System.DateTime> value);
    partial void OnDeletedChanged();
    #endregion
		
		public Text()
		{
			this._Content = default(EntityRef<Content>);
			this._User = default(EntityRef<User>);
			OnCreated();
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TextID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int TextID
		{
			get
			{
				return this._TextID;
			}
			set
			{
				if ((this._TextID != value))
				{
					this.OnTextIDChanging(value);
					this.SendPropertyChanging();
					this._TextID = value;
					this.SendPropertyChanged("TextID");
					this.OnTextIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="Text", Storage="_Text1", DbType="Text NOT NULL", CanBeNull=false, UpdateCheck=UpdateCheck.Never)]
		public string Text1
		{
			get
			{
				return this._Text1;
			}
			set
			{
				if ((this._Text1 != value))
				{
					this.OnText1Changing(value);
					this.SendPropertyChanging();
					this._Text1 = value;
					this.SendPropertyChanged("Text1");
					this.OnText1Changed();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Ordering", DbType="Int NOT NULL")]
		public int Ordering
		{
			get
			{
				return this._Ordering;
			}
			set
			{
				if ((this._Ordering != value))
				{
					this.OnOrderingChanging(value);
					this.SendPropertyChanging();
					this._Ordering = value;
					this.SendPropertyChanged("Ordering");
					this.OnOrderingChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="VarChar(50)")]
		public string Name
		{
			get
			{
				return this._Name;
			}
			set
			{
				if ((this._Name != value))
				{
					this.OnNameChanging(value);
					this.SendPropertyChanging();
					this._Name = value;
					this.SendPropertyChanged("Name");
					this.OnNameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Type", DbType="TinyInt NOT NULL")]
		public byte Type
		{
			get
			{
				return this._Type;
			}
			set
			{
				if ((this._Type != value))
				{
					this.OnTypeChanging(value);
					this.SendPropertyChanging();
					this._Type = value;
					this.SendPropertyChanged("Type");
					this.OnTypeChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContentID", DbType="Int NOT NULL")]
		public int ContentID
		{
			get
			{
				return this._ContentID;
			}
			set
			{
				if ((this._ContentID != value))
				{
					if (this._Content.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnContentIDChanging(value);
					this.SendPropertyChanging();
					this._ContentID = value;
					this.SendPropertyChanged("ContentID");
					this.OnContentIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserID", DbType="Int NOT NULL")]
		public int UserID
		{
			get
			{
				return this._UserID;
			}
			set
			{
				if ((this._UserID != value))
				{
					if (this._User.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.OnUserIDChanging(value);
					this.SendPropertyChanging();
					this._UserID = value;
					this.SendPropertyChanged("UserID");
					this.OnUserIDChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Created", DbType="DateTime NOT NULL")]
		public System.DateTime Created
		{
			get
			{
				return this._Created;
			}
			set
			{
				if ((this._Created != value))
				{
					this.OnCreatedChanging(value);
					this.SendPropertyChanging();
					this._Created = value;
					this.SendPropertyChanged("Created");
					this.OnCreatedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Deleted", DbType="DateTime")]
		public System.Nullable<System.DateTime> Deleted
		{
			get
			{
				return this._Deleted;
			}
			set
			{
				if ((this._Deleted != value))
				{
					this.OnDeletedChanging(value);
					this.SendPropertyChanging();
					this._Deleted = value;
					this.SendPropertyChanged("Deleted");
					this.OnDeletedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Content_Text", Storage="_Content", ThisKey="ContentID", OtherKey="ContentID", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]
		public Content Content
		{
			get
			{
				return this._Content.Entity;
			}
			set
			{
				Content previousValue = this._Content.Entity;
				if (((previousValue != value) 
							|| (this._Content.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._Content.Entity = null;
						previousValue.Texts.Remove(this);
					}
					this._Content.Entity = value;
					if ((value != null))
					{
						value.Texts.Add(this);
						this._ContentID = value.ContentID;
					}
					else
					{
						this._ContentID = default(int);
					}
					this.SendPropertyChanged("Content");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="User_Text", Storage="_User", ThisKey="UserID", OtherKey="UserID", IsForeignKey=true)]
		public User User
		{
			get
			{
				return this._User.Entity;
			}
			set
			{
				User previousValue = this._User.Entity;
				if (((previousValue != value) 
							|| (this._User.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._User.Entity = null;
						previousValue.Texts.Remove(this);
					}
					this._User.Entity = value;
					if ((value != null))
					{
						value.Texts.Add(this);
						this._UserID = value.UserID;
					}
					else
					{
						this._UserID = default(int);
					}
					this.SendPropertyChanged("User");
				}
			}
		}
		
		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
