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

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;



[System.Data.Linq.Mapping.DatabaseAttribute(Name="BlogNET")]
public partial class BlogNETDataContext : System.Data.Linq.DataContext
{
	
	private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
	
  #region Extensibility Method Definitions
  partial void OnCreated();
  partial void InsertComment(Comment instance);
  partial void UpdateComment(Comment instance);
  partial void DeleteComment(Comment instance);
  partial void InsertQuote(Quote instance);
  partial void UpdateQuote(Quote instance);
  partial void DeleteQuote(Quote instance);
  partial void InsertTag(Tag instance);
  partial void UpdateTag(Tag instance);
  partial void DeleteTag(Tag instance);
  partial void InsertSetting(Setting instance);
  partial void UpdateSetting(Setting instance);
  partial void DeleteSetting(Setting instance);
  partial void InsertNewsItem(NewsItem instance);
  partial void UpdateNewsItem(NewsItem instance);
  partial void DeleteNewsItem(NewsItem instance);
  #endregion
	
	public BlogNETDataContext() : 
			base(global::System.Configuration.ConfigurationManager.ConnectionStrings["BlogNETConnectionString"].ConnectionString, mappingSource)
	{
		OnCreated();
	}
	
	public BlogNETDataContext(string connection) : 
			base(connection, mappingSource)
	{
		OnCreated();
	}
	
	public BlogNETDataContext(System.Data.IDbConnection connection) : 
			base(connection, mappingSource)
	{
		OnCreated();
	}
	
	public BlogNETDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
			base(connection, mappingSource)
	{
		OnCreated();
	}
	
	public BlogNETDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
			base(connection, mappingSource)
	{
		OnCreated();
	}
	
	public System.Data.Linq.Table<Comment> Comments
	{
		get
		{
			return this.GetTable<Comment>();
		}
	}
	
	public System.Data.Linq.Table<Quote> Quotes
	{
		get
		{
			return this.GetTable<Quote>();
		}
	}
	
	public System.Data.Linq.Table<Tag> Tags
	{
		get
		{
			return this.GetTable<Tag>();
		}
	}
	
	public System.Data.Linq.Table<Setting> Settings
	{
		get
		{
			return this.GetTable<Setting>();
		}
	}
	
	public System.Data.Linq.Table<NewsItem> NewsItems
	{
		get
		{
			return this.GetTable<NewsItem>();
		}
	}
}

[Table(Name="dbo.Comments")]
public partial class Comment : INotifyPropertyChanging, INotifyPropertyChanged
{
	
	private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
	
	private int _CommentID;
	
	private int _NewsItemID;
	
	private string _AuthorUsername;
	
	private string _Text;
	
	private System.DateTime _PostDate;
	
	private System.Nullable<System.DateTime> _LastEditedDate;
	
	private string _LastEditedBy;
	
	private string _IPAddress;
	
	private EntityRef<NewsItem> _NewsItem;
	
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnCommentIDChanging(int value);
    partial void OnCommentIDChanged();
    partial void OnNewsItemIDChanging(int value);
    partial void OnNewsItemIDChanged();
    partial void OnAuthorUsernameChanging(string value);
    partial void OnAuthorUsernameChanged();
    partial void OnTextChanging(string value);
    partial void OnTextChanged();
    partial void OnPostDateChanging(System.DateTime value);
    partial void OnPostDateChanged();
    partial void OnLastEditedDateChanging(System.Nullable<System.DateTime> value);
    partial void OnLastEditedDateChanged();
    partial void OnLastEditedByChanging(string value);
    partial void OnLastEditedByChanged();
    partial void OnIPAddressChanging(string value);
    partial void OnIPAddressChanged();
    #endregion
	
	public Comment()
	{
		this._NewsItem = default(EntityRef<NewsItem>);
		OnCreated();
	}
	
	[Column(Storage="_CommentID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
	public int CommentID
	{
		get
		{
			return this._CommentID;
		}
		set
		{
			if ((this._CommentID != value))
			{
				this.OnCommentIDChanging(value);
				this.SendPropertyChanging();
				this._CommentID = value;
				this.SendPropertyChanged("CommentID");
				this.OnCommentIDChanged();
			}
		}
	}
	
	[Column(Storage="_NewsItemID", DbType="Int NOT NULL")]
	public int NewsItemID
	{
		get
		{
			return this._NewsItemID;
		}
		set
		{
			if ((this._NewsItemID != value))
			{
				if (this._NewsItem.HasLoadedOrAssignedValue)
				{
					throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
				}
				this.OnNewsItemIDChanging(value);
				this.SendPropertyChanging();
				this._NewsItemID = value;
				this.SendPropertyChanged("NewsItemID");
				this.OnNewsItemIDChanged();
			}
		}
	}
	
	[Column(Storage="_AuthorUsername", DbType="NVarChar(256) NOT NULL", CanBeNull=false)]
	public string AuthorUsername
	{
		get
		{
			return this._AuthorUsername;
		}
		set
		{
			if ((this._AuthorUsername != value))
			{
				this.OnAuthorUsernameChanging(value);
				this.SendPropertyChanging();
				this._AuthorUsername = value;
				this.SendPropertyChanged("AuthorUsername");
				this.OnAuthorUsernameChanged();
			}
		}
	}
	
	[Column(Storage="_Text", DbType="NVarChar(MAX)")]
	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();
			}
		}
	}
	
	[Column(Storage="_PostDate", DbType="DateTime NOT NULL")]
	public System.DateTime PostDate
	{
		get
		{
			return this._PostDate;
		}
		set
		{
			if ((this._PostDate != value))
			{
				this.OnPostDateChanging(value);
				this.SendPropertyChanging();
				this._PostDate = value;
				this.SendPropertyChanged("PostDate");
				this.OnPostDateChanged();
			}
		}
	}
	
	[Column(Storage="_LastEditedDate", DbType="DateTime")]
	public System.Nullable<System.DateTime> LastEditedDate
	{
		get
		{
			return this._LastEditedDate;
		}
		set
		{
			if ((this._LastEditedDate != value))
			{
				this.OnLastEditedDateChanging(value);
				this.SendPropertyChanging();
				this._LastEditedDate = value;
				this.SendPropertyChanged("LastEditedDate");
				this.OnLastEditedDateChanged();
			}
		}
	}
	
	[Column(Storage="_LastEditedBy", DbType="NVarChar(256)")]
	public string LastEditedBy
	{
		get
		{
			return this._LastEditedBy;
		}
		set
		{
			if ((this._LastEditedBy != value))
			{
				this.OnLastEditedByChanging(value);
				this.SendPropertyChanging();
				this._LastEditedBy = value;
				this.SendPropertyChanged("LastEditedBy");
				this.OnLastEditedByChanged();
			}
		}
	}
	
	[Column(Storage="_IPAddress", DbType="VarChar(50) NOT NULL", CanBeNull=false)]
	public string IPAddress
	{
		get
		{
			return this._IPAddress;
		}
		set
		{
			if ((this._IPAddress != value))
			{
				this.OnIPAddressChanging(value);
				this.SendPropertyChanging();
				this._IPAddress = value;
				this.SendPropertyChanged("IPAddress");
				this.OnIPAddressChanged();
			}
		}
	}
	
	[Association(Name="NewsItem_Comment", Storage="_NewsItem", ThisKey="NewsItemID", OtherKey="NewsItemID", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]
	public NewsItem NewsItem
	{
		get
		{
			return this._NewsItem.Entity;
		}
		set
		{
			NewsItem previousValue = this._NewsItem.Entity;
			if (((previousValue != value) 
						|| (this._NewsItem.HasLoadedOrAssignedValue == false)))
			{
				this.SendPropertyChanging();
				if ((previousValue != null))
				{
					this._NewsItem.Entity = null;
					previousValue.Comments.Remove(this);
				}
				this._NewsItem.Entity = value;
				if ((value != null))
				{
					value.Comments.Add(this);
					this._NewsItemID = value.NewsItemID;
				}
				else
				{
					this._NewsItemID = default(int);
				}
				this.SendPropertyChanged("NewsItem");
			}
		}
	}
	
	public event PropertyChangingEventHandler PropertyChanging;
	
	public event PropertyChangedEventHandler PropertyChanged;
	
	protected virtual void SendPropertyChanging()
	{
		if ((this.PropertyChanging != null))
		{
			this.PropertyChanging(this, emptyChangingEventArgs);
		}
	}
	
	protected virtual void SendPropertyChanged(String propertyName)
	{
		if ((this.PropertyChanged != null))
		{
			this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
		}
	}
}

[Table(Name="dbo.Quotes")]
public partial class Quote : INotifyPropertyChanging, INotifyPropertyChanged
{
	
	private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
	
	private int _QuoteID;
	
	private string _Message;
	
	private string _Author;
	
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnQuoteIDChanging(int value);
    partial void OnQuoteIDChanged();
    partial void OnMessageChanging(string value);
    partial void OnMessageChanged();
    partial void OnAuthorChanging(string value);
    partial void OnAuthorChanged();
    #endregion
	
	public Quote()
	{
		OnCreated();
	}
	
	[Column(Storage="_QuoteID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
	public int QuoteID
	{
		get
		{
			return this._QuoteID;
		}
		set
		{
			if ((this._QuoteID != value))
			{
				this.OnQuoteIDChanging(value);
				this.SendPropertyChanging();
				this._QuoteID = value;
				this.SendPropertyChanged("QuoteID");
				this.OnQuoteIDChanged();
			}
		}
	}
	
	[Column(Storage="_Message", DbType="NVarChar(256) 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();
			}
		}
	}
	
	[Column(Storage="_Author", DbType="NVarChar(128) NOT NULL", CanBeNull=false)]
	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();
			}
		}
	}
	
	public event PropertyChangingEventHandler PropertyChanging;
	
	public event PropertyChangedEventHandler PropertyChanged;
	
	protected virtual void SendPropertyChanging()
	{
		if ((this.PropertyChanging != null))
		{
			this.PropertyChanging(this, emptyChangingEventArgs);
		}
	}
	
	protected virtual void SendPropertyChanged(String propertyName)
	{
		if ((this.PropertyChanged != null))
		{
			this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
		}
	}
}

[Table(Name="dbo.Tags")]
public partial class Tag : INotifyPropertyChanging, INotifyPropertyChanged
{
	
	private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
	
	private int _NewsItemID;
	
	private string _TagValue;
	
	private EntityRef<NewsItem> _NewsItem;
	
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnNewsItemIDChanging(int value);
    partial void OnNewsItemIDChanged();
    partial void OnTagValueChanging(string value);
    partial void OnTagValueChanged();
    #endregion
	
	public Tag()
	{
		this._NewsItem = default(EntityRef<NewsItem>);
		OnCreated();
	}
	
	[Column(Storage="_NewsItemID", DbType="Int NOT NULL", IsPrimaryKey=true)]
	public int NewsItemID
	{
		get
		{
			return this._NewsItemID;
		}
		set
		{
			if ((this._NewsItemID != value))
			{
				if (this._NewsItem.HasLoadedOrAssignedValue)
				{
					throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
				}
				this.OnNewsItemIDChanging(value);
				this.SendPropertyChanging();
				this._NewsItemID = value;
				this.SendPropertyChanged("NewsItemID");
				this.OnNewsItemIDChanged();
			}
		}
	}
	
	[Column(Storage="_TagValue", DbType="NVarChar(64) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
	public string TagValue
	{
		get
		{
			return this._TagValue;
		}
		set
		{
			if ((this._TagValue != value))
			{
				this.OnTagValueChanging(value);
				this.SendPropertyChanging();
				this._TagValue = value;
				this.SendPropertyChanged("TagValue");
				this.OnTagValueChanged();
			}
		}
	}
	
	[Association(Name="NewsItem_Tag", Storage="_NewsItem", ThisKey="NewsItemID", OtherKey="NewsItemID", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")]
	public NewsItem NewsItem
	{
		get
		{
			return this._NewsItem.Entity;
		}
		set
		{
			NewsItem previousValue = this._NewsItem.Entity;
			if (((previousValue != value) 
						|| (this._NewsItem.HasLoadedOrAssignedValue == false)))
			{
				this.SendPropertyChanging();
				if ((previousValue != null))
				{
					this._NewsItem.Entity = null;
					previousValue.Tags.Remove(this);
				}
				this._NewsItem.Entity = value;
				if ((value != null))
				{
					value.Tags.Add(this);
					this._NewsItemID = value.NewsItemID;
				}
				else
				{
					this._NewsItemID = default(int);
				}
				this.SendPropertyChanged("NewsItem");
			}
		}
	}
	
	public event PropertyChangingEventHandler PropertyChanging;
	
	public event PropertyChangedEventHandler PropertyChanged;
	
	protected virtual void SendPropertyChanging()
	{
		if ((this.PropertyChanging != null))
		{
			this.PropertyChanging(this, emptyChangingEventArgs);
		}
	}
	
	protected virtual void SendPropertyChanged(String propertyName)
	{
		if ((this.PropertyChanged != null))
		{
			this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
		}
	}
}

[Table(Name="dbo.Settings")]
public partial class Setting : INotifyPropertyChanging, INotifyPropertyChanged
{
	
	private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
	
	private string _Key;
	
	private string _Value;
	
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnKeyChanging(string value);
    partial void OnKeyChanged();
    partial void OnValueChanging(string value);
    partial void OnValueChanged();
    #endregion
	
	public Setting()
	{
		OnCreated();
	}
	
	[Column(Name="[Key]", Storage="_Key", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
	public string Key
	{
		get
		{
			return this._Key;
		}
		set
		{
			if ((this._Key != value))
			{
				this.OnKeyChanging(value);
				this.SendPropertyChanging();
				this._Key = value;
				this.SendPropertyChanged("Key");
				this.OnKeyChanged();
			}
		}
	}
	
	[Column(Storage="_Value", DbType="NVarChar(MAX)")]
	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();
			}
		}
	}
	
	public event PropertyChangingEventHandler PropertyChanging;
	
	public event PropertyChangedEventHandler PropertyChanged;
	
	protected virtual void SendPropertyChanging()
	{
		if ((this.PropertyChanging != null))
		{
			this.PropertyChanging(this, emptyChangingEventArgs);
		}
	}
	
	protected virtual void SendPropertyChanged(String propertyName)
	{
		if ((this.PropertyChanged != null))
		{
			this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
		}
	}
}

[Table(Name="dbo.NewsItems")]
public partial class NewsItem : INotifyPropertyChanging, INotifyPropertyChanged
{
	
	private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
	
	private int _NewsItemID;
	
	private string _AuthorUsername;
	
	private string _Text;
	
	private string _ShortText;
	
	private System.DateTime _PostDate;
	
	private System.Nullable<System.DateTime> _LastEditedDate;
	
	private string _LastEditedBy;
	
	private int _CommentsCount;
	
	private System.Nullable<int> _LastCommentID;
	
	private System.Data.Linq.Binary _Image;
	
	private string _Title;
	
	private byte _CommentsPolicy;
	
	private bool _IsShortTextHtml;
	
	private bool _IsTextHtml;
	
	private EntitySet<Comment> _Comments;
	
	private EntitySet<Tag> _Tags;
	
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnNewsItemIDChanging(int value);
    partial void OnNewsItemIDChanged();
    partial void OnAuthorUsernameChanging(string value);
    partial void OnAuthorUsernameChanged();
    partial void OnTextChanging(string value);
    partial void OnTextChanged();
    partial void OnShortTextChanging(string value);
    partial void OnShortTextChanged();
    partial void OnPostDateChanging(System.DateTime value);
    partial void OnPostDateChanged();
    partial void OnLastEditedDateChanging(System.Nullable<System.DateTime> value);
    partial void OnLastEditedDateChanged();
    partial void OnLastEditedByChanging(string value);
    partial void OnLastEditedByChanged();
    partial void OnCommentsCountChanging(int value);
    partial void OnCommentsCountChanged();
    partial void OnLastCommentIDChanging(System.Nullable<int> value);
    partial void OnLastCommentIDChanged();
    partial void OnImageChanging(System.Data.Linq.Binary value);
    partial void OnImageChanged();
    partial void OnTitleChanging(string value);
    partial void OnTitleChanged();
    partial void OnCommentsPolicyChanging(byte value);
    partial void OnCommentsPolicyChanged();
    partial void OnIsShortTextHtmlChanging(bool value);
    partial void OnIsShortTextHtmlChanged();
    partial void OnIsTextHtmlChanging(bool value);
    partial void OnIsTextHtmlChanged();
    #endregion
	
	public NewsItem()
	{
		this._Comments = new EntitySet<Comment>(new Action<Comment>(this.attach_Comments), new Action<Comment>(this.detach_Comments));
		this._Tags = new EntitySet<Tag>(new Action<Tag>(this.attach_Tags), new Action<Tag>(this.detach_Tags));
		OnCreated();
	}
	
	[Column(Storage="_NewsItemID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
	public int NewsItemID
	{
		get
		{
			return this._NewsItemID;
		}
		set
		{
			if ((this._NewsItemID != value))
			{
				this.OnNewsItemIDChanging(value);
				this.SendPropertyChanging();
				this._NewsItemID = value;
				this.SendPropertyChanged("NewsItemID");
				this.OnNewsItemIDChanged();
			}
		}
	}
	
	[Column(Storage="_AuthorUsername", DbType="NVarChar(256) NOT NULL", CanBeNull=false)]
	public string AuthorUsername
	{
		get
		{
			return this._AuthorUsername;
		}
		set
		{
			if ((this._AuthorUsername != value))
			{
				this.OnAuthorUsernameChanging(value);
				this.SendPropertyChanging();
				this._AuthorUsername = value;
				this.SendPropertyChanged("AuthorUsername");
				this.OnAuthorUsernameChanged();
			}
		}
	}
	
	[Column(Storage="_Text", DbType="NVarChar(MAX)")]
	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();
			}
		}
	}
	
	[Column(Storage="_ShortText", DbType="NVarChar(MAX)")]
	public string ShortText
	{
		get
		{
			return this._ShortText;
		}
		set
		{
			if ((this._ShortText != value))
			{
				this.OnShortTextChanging(value);
				this.SendPropertyChanging();
				this._ShortText = value;
				this.SendPropertyChanged("ShortText");
				this.OnShortTextChanged();
			}
		}
	}
	
	[Column(Storage="_PostDate", DbType="DateTime NOT NULL")]
	public System.DateTime PostDate
	{
		get
		{
			return this._PostDate;
		}
		set
		{
			if ((this._PostDate != value))
			{
				this.OnPostDateChanging(value);
				this.SendPropertyChanging();
				this._PostDate = value;
				this.SendPropertyChanged("PostDate");
				this.OnPostDateChanged();
			}
		}
	}
	
	[Column(Storage="_LastEditedDate", DbType="DateTime")]
	public System.Nullable<System.DateTime> LastEditedDate
	{
		get
		{
			return this._LastEditedDate;
		}
		set
		{
			if ((this._LastEditedDate != value))
			{
				this.OnLastEditedDateChanging(value);
				this.SendPropertyChanging();
				this._LastEditedDate = value;
				this.SendPropertyChanged("LastEditedDate");
				this.OnLastEditedDateChanged();
			}
		}
	}
	
	[Column(Storage="_LastEditedBy", DbType="NVarChar(256)")]
	public string LastEditedBy
	{
		get
		{
			return this._LastEditedBy;
		}
		set
		{
			if ((this._LastEditedBy != value))
			{
				this.OnLastEditedByChanging(value);
				this.SendPropertyChanging();
				this._LastEditedBy = value;
				this.SendPropertyChanged("LastEditedBy");
				this.OnLastEditedByChanged();
			}
		}
	}
	
	[Column(Storage="_CommentsCount", DbType="Int NOT NULL")]
	public int CommentsCount
	{
		get
		{
			return this._CommentsCount;
		}
		set
		{
			if ((this._CommentsCount != value))
			{
				this.OnCommentsCountChanging(value);
				this.SendPropertyChanging();
				this._CommentsCount = value;
				this.SendPropertyChanged("CommentsCount");
				this.OnCommentsCountChanged();
			}
		}
	}
	
	[Column(Storage="_LastCommentID", DbType="Int")]
	public System.Nullable<int> LastCommentID
	{
		get
		{
			return this._LastCommentID;
		}
		set
		{
			if ((this._LastCommentID != value))
			{
				this.OnLastCommentIDChanging(value);
				this.SendPropertyChanging();
				this._LastCommentID = value;
				this.SendPropertyChanged("LastCommentID");
				this.OnLastCommentIDChanged();
			}
		}
	}
	
	[Column(Storage="_Image", DbType="VarBinary(MAX)", UpdateCheck=UpdateCheck.Never)]
	public System.Data.Linq.Binary Image
	{
		get
		{
			return this._Image;
		}
		set
		{
			if ((this._Image != value))
			{
				this.OnImageChanging(value);
				this.SendPropertyChanging();
				this._Image = value;
				this.SendPropertyChanged("Image");
				this.OnImageChanged();
			}
		}
	}
	
	[Column(Storage="_Title", DbType="NVarChar(256) 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();
			}
		}
	}
	
	[Column(Storage="_CommentsPolicy", DbType="TinyInt NOT NULL", UpdateCheck=UpdateCheck.Never)]
	private byte CommentsPolicy
	{
		get
		{
			return this._CommentsPolicy;
		}
		set
		{
			if ((this._CommentsPolicy != value))
			{
				this.OnCommentsPolicyChanging(value);
				this.SendPropertyChanging();
				this._CommentsPolicy = value;
				this.SendPropertyChanged("CommentsPolicy");
				this.OnCommentsPolicyChanged();
			}
		}
	}
	
	[Column(Storage="_IsShortTextHtml", DbType="Bit NOT NULL")]
	public bool IsShortTextHtml
	{
		get
		{
			return this._IsShortTextHtml;
		}
		set
		{
			if ((this._IsShortTextHtml != value))
			{
				this.OnIsShortTextHtmlChanging(value);
				this.SendPropertyChanging();
				this._IsShortTextHtml = value;
				this.SendPropertyChanged("IsShortTextHtml");
				this.OnIsShortTextHtmlChanged();
			}
		}
	}
	
	[Column(Storage="_IsTextHtml", DbType="Bit NOT NULL")]
	public bool IsTextHtml
	{
		get
		{
			return this._IsTextHtml;
		}
		set
		{
			if ((this._IsTextHtml != value))
			{
				this.OnIsTextHtmlChanging(value);
				this.SendPropertyChanging();
				this._IsTextHtml = value;
				this.SendPropertyChanged("IsTextHtml");
				this.OnIsTextHtmlChanged();
			}
		}
	}
	
	[Association(Name="NewsItem_Comment", Storage="_Comments", ThisKey="NewsItemID", OtherKey="NewsItemID")]
	public EntitySet<Comment> Comments
	{
		get
		{
			return this._Comments;
		}
		set
		{
			this._Comments.Assign(value);
		}
	}
	
	[Association(Name="NewsItem_Tag", Storage="_Tags", ThisKey="NewsItemID", OtherKey="NewsItemID")]
	public EntitySet<Tag> Tags
	{
		get
		{
			return this._Tags;
		}
		set
		{
			this._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_Comments(Comment entity)
	{
		this.SendPropertyChanging();
		entity.NewsItem = this;
	}
	
	private void detach_Comments(Comment entity)
	{
		this.SendPropertyChanging();
		entity.NewsItem = null;
	}
	
	private void attach_Tags(Tag entity)
	{
		this.SendPropertyChanging();
		entity.NewsItem = this;
	}
	
	private void detach_Tags(Tag entity)
	{
		this.SendPropertyChanging();
		entity.NewsItem = null;
	}
}
#pragma warning restore 1591
