#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
//     此代码由工具生成。
//     运行时版本:4.0.30319.239
//
//     对此文件的更改可能会导致不正确的行为，并且如果
//     重新生成代码，这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------

namespace DataAccess.Mapping
{
	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;
	
	
	[global::System.Data.Linq.Mapping.DatabaseAttribute(Name="Blogo")]
	public partial class BlogMapDataContext : System.Data.Linq.DataContext
	{
		
		private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
		
    #region 可扩展性方法定义
    partial void OnCreated();
    partial void Insertauthors(authors instance);
    partial void Updateauthors(authors instance);
    partial void Deleteauthors(authors instance);
    partial void Insertblog_tags(blog_tags instance);
    partial void Updateblog_tags(blog_tags instance);
    partial void Deleteblog_tags(blog_tags instance);
    partial void Insertblogentries(blogentries instance);
    partial void Updateblogentries(blogentries instance);
    partial void Deleteblogentries(blogentries instance);
    partial void Insertcomments(comments instance);
    partial void Updatecomments(comments instance);
    partial void Deletecomments(comments instance);
    partial void Insertfiles(files instance);
    partial void Updatefiles(files instance);
    partial void Deletefiles(files instance);
    partial void Inserttags(tags instance);
    partial void Updatetags(tags instance);
    partial void Deletetags(tags instance);
    partial void Insertlogs(logs instance);
    partial void Updatelogs(logs instance);
    partial void Deletelogs(logs instance);
    #endregion
		
		public BlogMapDataContext() : 
				base(global::DataAccess.Properties.Settings.Default.BlogoConnectionString, mappingSource)
		{
			OnCreated();
		}
		
		public BlogMapDataContext(string connection) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public BlogMapDataContext(System.Data.IDbConnection connection) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public BlogMapDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public BlogMapDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public System.Data.Linq.Table<authors> authors
		{
			get
			{
				return this.GetTable<authors>();
			}
		}
		
		public System.Data.Linq.Table<blog_tags> blog_tags
		{
			get
			{
				return this.GetTable<blog_tags>();
			}
		}
		
		public System.Data.Linq.Table<blogentries> blogentries
		{
			get
			{
				return this.GetTable<blogentries>();
			}
		}
		
		public System.Data.Linq.Table<comments> comments
		{
			get
			{
				return this.GetTable<comments>();
			}
		}
		
		public System.Data.Linq.Table<files> files
		{
			get
			{
				return this.GetTable<files>();
			}
		}
		
		public System.Data.Linq.Table<tags> tags
		{
			get
			{
				return this.GetTable<tags>();
			}
		}
		
		public System.Data.Linq.Table<logs> logs
		{
			get
			{
				return this.GetTable<logs>();
			}
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.authors")]
	public partial class authors : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _id;
		
		private string _username;
		
		private string _password;
		
		private string _salt;
		
		private EntitySet<blogentries> _blogentries;
		
    #region 可扩展性方法定义
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnidChanging(int value);
    partial void OnidChanged();
    partial void OnusernameChanging(string value);
    partial void OnusernameChanged();
    partial void OnpasswordChanging(string value);
    partial void OnpasswordChanged();
    partial void OnsaltChanging(string value);
    partial void OnsaltChanged();
    #endregion
		
		public authors()
		{
			this._blogentries = new EntitySet<blogentries>(new Action<blogentries>(this.attach_blogentries), new Action<blogentries>(this.detach_blogentries));
			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="_username", DbType="NVarChar(100)")]
		public string username
		{
			get
			{
				return this._username;
			}
			set
			{
				if ((this._username != value))
				{
					this.OnusernameChanging(value);
					this.SendPropertyChanging();
					this._username = value;
					this.SendPropertyChanged("username");
					this.OnusernameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_password", DbType="NVarChar(50)")]
		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="_salt", DbType="NVarChar(50)")]
		public string salt
		{
			get
			{
				return this._salt;
			}
			set
			{
				if ((this._salt != value))
				{
					this.OnsaltChanging(value);
					this.SendPropertyChanging();
					this._salt = value;
					this.SendPropertyChanged("salt");
					this.OnsaltChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="authors_blogentries", Storage="_blogentries", ThisKey="id", OtherKey="author_id")]
		public EntitySet<blogentries> blogentries
		{
			get
			{
				return this._blogentries;
			}
			set
			{
				this._blogentries.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_blogentries(blogentries entity)
		{
			this.SendPropertyChanging();
			entity.authors = this;
		}
		
		private void detach_blogentries(blogentries entity)
		{
			this.SendPropertyChanging();
			entity.authors = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.blog_tags")]
	public partial class blog_tags : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _id;
		
		private System.Nullable<int> _tag_id;
		
		private System.Nullable<int> _blog_id;
		
		private EntityRef<blogentries> _blogentries;
		
		private EntityRef<tags> _tags;
		
    #region 可扩展性方法定义
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnidChanging(int value);
    partial void OnidChanged();
    partial void Ontag_idChanging(System.Nullable<int> value);
    partial void Ontag_idChanged();
    partial void Onblog_idChanging(System.Nullable<int> value);
    partial void Onblog_idChanged();
    #endregion
		
		public blog_tags()
		{
			this._blogentries = default(EntityRef<blogentries>);
			this._tags = default(EntityRef<tags>);
			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="_tag_id", DbType="Int")]
		public System.Nullable<int> tag_id
		{
			get
			{
				return this._tag_id;
			}
			set
			{
				if ((this._tag_id != value))
				{
					if (this._tags.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.Ontag_idChanging(value);
					this.SendPropertyChanging();
					this._tag_id = value;
					this.SendPropertyChanged("tag_id");
					this.Ontag_idChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_blog_id", DbType="Int")]
		public System.Nullable<int> blog_id
		{
			get
			{
				return this._blog_id;
			}
			set
			{
				if ((this._blog_id != value))
				{
					if (this._blogentries.HasLoadedOrAssignedValue)
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.Onblog_idChanging(value);
					this.SendPropertyChanging();
					this._blog_id = value;
					this.SendPropertyChanged("blog_id");
					this.Onblog_idChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="blogentries_blog_tags", Storage="_blogentries", ThisKey="blog_id", OtherKey="id", IsForeignKey=true)]
		public blogentries blogentries
		{
			get
			{
				return this._blogentries.Entity;
			}
			set
			{
				blogentries previousValue = this._blogentries.Entity;
				if (((previousValue != value) 
							|| (this._blogentries.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._blogentries.Entity = null;
						previousValue.blog_tags.Remove(this);
					}
					this._blogentries.Entity = value;
					if ((value != null))
					{
						value.blog_tags.Add(this);
						this._blog_id = value.id;
					}
					else
					{
						this._blog_id = default(Nullable<int>);
					}
					this.SendPropertyChanged("blogentries");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="tags_blog_tags", Storage="_tags", ThisKey="tag_id", OtherKey="id", IsForeignKey=true)]
		public tags tags
		{
			get
			{
				return this._tags.Entity;
			}
			set
			{
				tags previousValue = this._tags.Entity;
				if (((previousValue != value) 
							|| (this._tags.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._tags.Entity = null;
						previousValue.blog_tags.Remove(this);
					}
					this._tags.Entity = value;
					if ((value != null))
					{
						value.blog_tags.Add(this);
						this._tag_id = value.id;
					}
					else
					{
						this._tag_id = default(Nullable<int>);
					}
					this.SendPropertyChanged("tags");
				}
			}
		}
		
		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.blogentries")]
	public partial class blogentries : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _id;
		
		private System.Nullable<int> _author_id;
		
		private string _title;
		
		private string _description;
		
		private string _type;
		
		private System.Nullable<bool> _allowcomments;
		
		private System.Nullable<bool> _markprivate;
		
		private string _body;
		
		private System.Nullable<System.DateTime> _datecreated;
		
		private System.Nullable<System.DateTime> _datepublished;
		
		private System.Nullable<System.DateTime> _datemodified;
		
		private EntitySet<blog_tags> _blog_tags;
		
		private EntityRef<authors> _authors;
		
		private EntityRef<comments> _comments;
		
    #region 可扩展性方法定义
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnidChanging(int value);
    partial void OnidChanged();
    partial void Onauthor_idChanging(System.Nullable<int> value);
    partial void Onauthor_idChanged();
    partial void OntitleChanging(string value);
    partial void OntitleChanged();
    partial void OndescriptionChanging(string value);
    partial void OndescriptionChanged();
    partial void OntypeChanging(string value);
    partial void OntypeChanged();
    partial void OnallowcommentsChanging(System.Nullable<bool> value);
    partial void OnallowcommentsChanged();
    partial void OnmarkprivateChanging(System.Nullable<bool> value);
    partial void OnmarkprivateChanged();
    partial void OnbodyChanging(string value);
    partial void OnbodyChanged();
    partial void OndatecreatedChanging(System.Nullable<System.DateTime> value);
    partial void OndatecreatedChanged();
    partial void OndatepublishedChanging(System.Nullable<System.DateTime> value);
    partial void OndatepublishedChanged();
    partial void OndatemodifiedChanging(System.Nullable<System.DateTime> value);
    partial void OndatemodifiedChanged();
    #endregion
		
		public blogentries()
		{
			this._blog_tags = new EntitySet<blog_tags>(new Action<blog_tags>(this.attach_blog_tags), new Action<blog_tags>(this.detach_blog_tags));
			this._authors = default(EntityRef<authors>);
			this._comments = default(EntityRef<comments>);
			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="_author_id", DbType="Int")]
		public System.Nullable<int> author_id
		{
			get
			{
				return this._author_id;
			}
			set
			{
				if ((this._author_id != value))
				{
					if ((this._authors.HasLoadedOrAssignedValue || this._comments.HasLoadedOrAssignedValue))
					{
						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
					}
					this.Onauthor_idChanging(value);
					this.SendPropertyChanging();
					this._author_id = value;
					this.SendPropertyChanged("author_id");
					this.Onauthor_idChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_title", DbType="NVarChar(100)")]
		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="_description", DbType="NText", 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.ColumnAttribute(Storage="_type", DbType="NVarChar(10)")]
		public string 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="_allowcomments", DbType="Bit")]
		public System.Nullable<bool> allowcomments
		{
			get
			{
				return this._allowcomments;
			}
			set
			{
				if ((this._allowcomments != value))
				{
					this.OnallowcommentsChanging(value);
					this.SendPropertyChanging();
					this._allowcomments = value;
					this.SendPropertyChanged("allowcomments");
					this.OnallowcommentsChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_markprivate", DbType="Bit")]
		public System.Nullable<bool> markprivate
		{
			get
			{
				return this._markprivate;
			}
			set
			{
				if ((this._markprivate != value))
				{
					this.OnmarkprivateChanging(value);
					this.SendPropertyChanging();
					this._markprivate = value;
					this.SendPropertyChanged("markprivate");
					this.OnmarkprivateChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_body", DbType="NText", UpdateCheck=UpdateCheck.Never)]
		public string body
		{
			get
			{
				return this._body;
			}
			set
			{
				if ((this._body != value))
				{
					this.OnbodyChanging(value);
					this.SendPropertyChanging();
					this._body = value;
					this.SendPropertyChanged("body");
					this.OnbodyChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_datecreated", DbType="DateTime")]
		public System.Nullable<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="_datepublished", DbType="DateTime")]
		public System.Nullable<System.DateTime> datepublished
		{
			get
			{
				return this._datepublished;
			}
			set
			{
				if ((this._datepublished != value))
				{
					this.OndatepublishedChanging(value);
					this.SendPropertyChanging();
					this._datepublished = value;
					this.SendPropertyChanged("datepublished");
					this.OndatepublishedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_datemodified", DbType="DateTime")]
		public System.Nullable<System.DateTime> datemodified
		{
			get
			{
				return this._datemodified;
			}
			set
			{
				if ((this._datemodified != value))
				{
					this.OndatemodifiedChanging(value);
					this.SendPropertyChanging();
					this._datemodified = value;
					this.SendPropertyChanged("datemodified");
					this.OndatemodifiedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="blogentries_blog_tags", Storage="_blog_tags", ThisKey="id", OtherKey="blog_id")]
		public EntitySet<blog_tags> blog_tags
		{
			get
			{
				return this._blog_tags;
			}
			set
			{
				this._blog_tags.Assign(value);
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="authors_blogentries", Storage="_authors", ThisKey="author_id", OtherKey="id", IsForeignKey=true)]
		public authors authors
		{
			get
			{
				return this._authors.Entity;
			}
			set
			{
				authors previousValue = this._authors.Entity;
				if (((previousValue != value) 
							|| (this._authors.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._authors.Entity = null;
						previousValue.blogentries.Remove(this);
					}
					this._authors.Entity = value;
					if ((value != null))
					{
						value.blogentries.Add(this);
						this._author_id = value.id;
					}
					else
					{
						this._author_id = default(Nullable<int>);
					}
					this.SendPropertyChanged("authors");
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="comments_blogentries", Storage="_comments", ThisKey="author_id", OtherKey="id", IsForeignKey=true)]
		public comments comments
		{
			get
			{
				return this._comments.Entity;
			}
			set
			{
				comments previousValue = this._comments.Entity;
				if (((previousValue != value) 
							|| (this._comments.HasLoadedOrAssignedValue == false)))
				{
					this.SendPropertyChanging();
					if ((previousValue != null))
					{
						this._comments.Entity = null;
						previousValue.blogentries.Remove(this);
					}
					this._comments.Entity = value;
					if ((value != null))
					{
						value.blogentries.Add(this);
						this._author_id = value.id;
					}
					else
					{
						this._author_id = default(Nullable<int>);
					}
					this.SendPropertyChanged("comments");
				}
			}
		}
		
		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_blog_tags(blog_tags entity)
		{
			this.SendPropertyChanging();
			entity.blogentries = this;
		}
		
		private void detach_blog_tags(blog_tags entity)
		{
			this.SendPropertyChanging();
			entity.blogentries = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.comments")]
	public partial class comments : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _id;
		
		private string _author;
		
		private System.Nullable<int> _blog_id;
		
		private string _ip;
		
		private System.Nullable<System.DateTime> _datecreated;
		
		private System.Nullable<System.DateTime> _datepulished;
		
		private string _body;
		
		private EntitySet<blogentries> _blogentries;
		
    #region 可扩展性方法定义
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnidChanging(int value);
    partial void OnidChanged();
    partial void OnauthorChanging(string value);
    partial void OnauthorChanged();
    partial void Onblog_idChanging(System.Nullable<int> value);
    partial void Onblog_idChanged();
    partial void OnipChanging(string value);
    partial void OnipChanged();
    partial void OndatecreatedChanging(System.Nullable<System.DateTime> value);
    partial void OndatecreatedChanged();
    partial void OndatepulishedChanging(System.Nullable<System.DateTime> value);
    partial void OndatepulishedChanged();
    partial void OnbodyChanging(string value);
    partial void OnbodyChanged();
    #endregion
		
		public comments()
		{
			this._blogentries = new EntitySet<blogentries>(new Action<blogentries>(this.attach_blogentries), new Action<blogentries>(this.detach_blogentries));
			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="_author", DbType="NVarChar(100)")]
		public string author
		{
			get
			{
				return this._author;
			}
			set
			{
				if ((this._author != value))
				{
					this.OnauthorChanging(value);
					this.SendPropertyChanging();
					this._author = value;
					this.SendPropertyChanged("author");
					this.OnauthorChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_blog_id", DbType="Int")]
		public System.Nullable<int> blog_id
		{
			get
			{
				return this._blog_id;
			}
			set
			{
				if ((this._blog_id != value))
				{
					this.Onblog_idChanging(value);
					this.SendPropertyChanging();
					this._blog_id = value;
					this.SendPropertyChanged("blog_id");
					this.Onblog_idChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ip", DbType="NVarChar(100)")]
		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="_datecreated", DbType="DateTime")]
		public System.Nullable<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="_datepulished", DbType="DateTime")]
		public System.Nullable<System.DateTime> datepulished
		{
			get
			{
				return this._datepulished;
			}
			set
			{
				if ((this._datepulished != value))
				{
					this.OndatepulishedChanging(value);
					this.SendPropertyChanging();
					this._datepulished = value;
					this.SendPropertyChanged("datepulished");
					this.OndatepulishedChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_body", DbType="NText", UpdateCheck=UpdateCheck.Never)]
		public string body
		{
			get
			{
				return this._body;
			}
			set
			{
				if ((this._body != value))
				{
					this.OnbodyChanging(value);
					this.SendPropertyChanging();
					this._body = value;
					this.SendPropertyChanged("body");
					this.OnbodyChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="comments_blogentries", Storage="_blogentries", ThisKey="id", OtherKey="author_id")]
		public EntitySet<blogentries> blogentries
		{
			get
			{
				return this._blogentries;
			}
			set
			{
				this._blogentries.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_blogentries(blogentries entity)
		{
			this.SendPropertyChanging();
			entity.comments = this;
		}
		
		private void detach_blogentries(blogentries entity)
		{
			this.SendPropertyChanging();
			entity.comments = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.files")]
	public partial class files : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _id;
		
		private string _filename;
		
		private string _mime;
		
		private System.Data.Linq.Binary _filecontent;
		
    #region 可扩展性方法定义
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnidChanging(int value);
    partial void OnidChanged();
    partial void OnfilenameChanging(string value);
    partial void OnfilenameChanged();
    partial void OnmimeChanging(string value);
    partial void OnmimeChanged();
    partial void OnfilecontentChanging(System.Data.Linq.Binary value);
    partial void OnfilecontentChanged();
    #endregion
		
		public files()
		{
			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="_filename", DbType="NVarChar(250)")]
		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="_mime", DbType="NVarChar(50)")]
		public string mime
		{
			get
			{
				return this._mime;
			}
			set
			{
				if ((this._mime != value))
				{
					this.OnmimeChanging(value);
					this.SendPropertyChanging();
					this._mime = value;
					this.SendPropertyChanged("mime");
					this.OnmimeChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_filecontent", DbType="VarBinary(MAX)", UpdateCheck=UpdateCheck.Never)]
		public System.Data.Linq.Binary filecontent
		{
			get
			{
				return this._filecontent;
			}
			set
			{
				if ((this._filecontent != value))
				{
					this.OnfilecontentChanging(value);
					this.SendPropertyChanging();
					this._filecontent = value;
					this.SendPropertyChanged("filecontent");
					this.OnfilecontentChanged();
				}
			}
		}
		
		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.tags")]
	public partial class tags : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _id;
		
		private string _tagname;
		
		private EntitySet<blog_tags> _blog_tags;
		
    #region 可扩展性方法定义
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnidChanging(int value);
    partial void OnidChanged();
    partial void OntagnameChanging(string value);
    partial void OntagnameChanged();
    #endregion
		
		public tags()
		{
			this._blog_tags = new EntitySet<blog_tags>(new Action<blog_tags>(this.attach_blog_tags), new Action<blog_tags>(this.detach_blog_tags));
			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="_tagname", DbType="NVarChar(100)")]
		public string tagname
		{
			get
			{
				return this._tagname;
			}
			set
			{
				if ((this._tagname != value))
				{
					this.OntagnameChanging(value);
					this.SendPropertyChanging();
					this._tagname = value;
					this.SendPropertyChanged("tagname");
					this.OntagnameChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="tags_blog_tags", Storage="_blog_tags", ThisKey="id", OtherKey="tag_id")]
		public EntitySet<blog_tags> blog_tags
		{
			get
			{
				return this._blog_tags;
			}
			set
			{
				this._blog_tags.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_blog_tags(blog_tags entity)
		{
			this.SendPropertyChanging();
			entity.tags = this;
		}
		
		private void detach_blog_tags(blog_tags entity)
		{
			this.SendPropertyChanging();
			entity.tags = null;
		}
	}
	
	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.logs")]
	public partial class logs : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _id;
		
		private System.Nullable<System.DateTime> _date;
		
		private string _event;
		
    #region 可扩展性方法定义
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnidChanging(int value);
    partial void OnidChanged();
    partial void OndateChanging(System.Nullable<System.DateTime> value);
    partial void OndateChanged();
    partial void OneventChanging(string value);
    partial void OneventChanged();
    #endregion
		
		public 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="_date", DbType="DateTime")]
		public System.Nullable<System.DateTime> date
		{
			get
			{
				return this._date;
			}
			set
			{
				if ((this._date != value))
				{
					this.OndateChanging(value);
					this.SendPropertyChanging();
					this._date = value;
					this.SendPropertyChanged("date");
					this.OndateChanged();
				}
			}
		}
		
		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="event", Storage="_event", DbType="NText", UpdateCheck=UpdateCheck.Never)]
		public string @event
		{
			get
			{
				return this._event;
			}
			set
			{
				if ((this._event != value))
				{
					this.OneventChanging(value);
					this.SendPropertyChanging();
					this._event = value;
					this.SendPropertyChanged("@event");
					this.OneventChanged();
				}
			}
		}
		
		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
