#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.3603
//
//     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="ASPNETDB")]
public partial class NorthwindDataContext : System.Data.Linq.DataContext
{
	
	private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
	
  #region Extensibility Method Definitions
  partial void OnCreated();
  partial void InsertCategoryArticleRelation(CategoryArticleRelation instance);
  partial void UpdateCategoryArticleRelation(CategoryArticleRelation instance);
  partial void DeleteCategoryArticleRelation(CategoryArticleRelation instance);
  partial void Insertcategory(category instance);
  partial void Updatecategory(category instance);
  partial void Deletecategory(category instance);
  partial void Insertaspnet_User(aspnet_User instance);
  partial void Updateaspnet_User(aspnet_User instance);
  partial void Deleteaspnet_User(aspnet_User instance);
  partial void Insertarticle(article instance);
  partial void Updatearticle(article instance);
  partial void Deletearticle(article instance);
  partial void InsertCategoryTestQuestionRelation(CategoryTestQuestionRelation instance);
  partial void UpdateCategoryTestQuestionRelation(CategoryTestQuestionRelation instance);
  partial void DeleteCategoryTestQuestionRelation(CategoryTestQuestionRelation instance);
  partial void Insertnew(@new instance);
  partial void Updatenew(@new instance);
  partial void Deletenew(@new instance);
  partial void Inserttest(test instance);
  partial void Updatetest(test instance);
  partial void Deletetest(test instance);
  partial void Insertcomment(comment instance);
  partial void Updatecomment(comment instance);
  partial void Deletecomment(comment instance);
  partial void Insertphoto(photo instance);
  partial void Updatephoto(photo instance);
  partial void Deletephoto(photo instance);
  #endregion
	
	public NorthwindDataContext() : 
			base(global::System.Configuration.ConfigurationManager.ConnectionStrings["ASPNETDBConnectionString"].ConnectionString, mappingSource)
	{
		OnCreated();
	}
	
	public NorthwindDataContext(string connection) : 
			base(connection, mappingSource)
	{
		OnCreated();
	}
	
	public NorthwindDataContext(System.Data.IDbConnection connection) : 
			base(connection, mappingSource)
	{
		OnCreated();
	}
	
	public NorthwindDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
			base(connection, mappingSource)
	{
		OnCreated();
	}
	
	public NorthwindDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
			base(connection, mappingSource)
	{
		OnCreated();
	}
	
	public System.Data.Linq.Table<CategoryArticleRelation> CategoryArticleRelations
	{
		get
		{
			return this.GetTable<CategoryArticleRelation>();
		}
	}
	
	public System.Data.Linq.Table<category> categories
	{
		get
		{
			return this.GetTable<category>();
		}
	}
	
	public System.Data.Linq.Table<aspnet_User> aspnet_Users
	{
		get
		{
			return this.GetTable<aspnet_User>();
		}
	}
	
	public System.Data.Linq.Table<article> articles
	{
		get
		{
			return this.GetTable<article>();
		}
	}
	
	public System.Data.Linq.Table<CategoryTestQuestionRelation> CategoryTestQuestionRelations
	{
		get
		{
			return this.GetTable<CategoryTestQuestionRelation>();
		}
	}
	
	public System.Data.Linq.Table<@new> news
	{
		get
		{
			return this.GetTable<@new>();
		}
	}
	
	public System.Data.Linq.Table<test> tests
	{
		get
		{
			return this.GetTable<test>();
		}
	}
	
	public System.Data.Linq.Table<comment> comments
	{
		get
		{
			return this.GetTable<comment>();
		}
	}
	
	public System.Data.Linq.Table<photo> photos
	{
		get
		{
			return this.GetTable<photo>();
		}
	}
}

[Table(Name="dbo.CategoryArticleRelations")]
public partial class CategoryArticleRelation : INotifyPropertyChanging, INotifyPropertyChanged
{
	
	private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
	
	private int _id;
	
	private int _category_id;
	
	private int _article_id;
	
	private EntitySet<category> _categories;
	
	private EntityRef<article> _article;
	
    #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 Oncategory_idChanging(int value);
    partial void Oncategory_idChanged();
    partial void Onarticle_idChanging(int value);
    partial void Onarticle_idChanged();
    #endregion
	
	public CategoryArticleRelation()
	{
		this._categories = new EntitySet<category>(new Action<category>(this.attach_categories), new Action<category>(this.detach_categories));
		this._article = default(EntityRef<article>);
		OnCreated();
	}
	
	[Column(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();
			}
		}
	}
	
	[Column(Storage="_category_id", DbType="Int NOT NULL")]
	public int category_id
	{
		get
		{
			return this._category_id;
		}
		set
		{
			if ((this._category_id != value))
			{
				this.Oncategory_idChanging(value);
				this.SendPropertyChanging();
				this._category_id = value;
				this.SendPropertyChanged("category_id");
				this.Oncategory_idChanged();
			}
		}
	}
	
	[Column(Storage="_article_id", DbType="Int NOT NULL")]
	public int article_id
	{
		get
		{
			return this._article_id;
		}
		set
		{
			if ((this._article_id != value))
			{
				if (this._article.HasLoadedOrAssignedValue)
				{
					throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
				}
				this.Onarticle_idChanging(value);
				this.SendPropertyChanging();
				this._article_id = value;
				this.SendPropertyChanged("article_id");
				this.Onarticle_idChanged();
			}
		}
	}
	
	[Association(Name="CategoryArticleRelation_category", Storage="_categories", ThisKey="category_id", OtherKey="category_id")]
	public EntitySet<category> categories
	{
		get
		{
			return this._categories;
		}
		set
		{
			this._categories.Assign(value);
		}
	}
	
	[Association(Name="article_CategoryArticleRelation", Storage="_article", ThisKey="article_id", OtherKey="article_id", IsForeignKey=true)]
	public article article
	{
		get
		{
			return this._article.Entity;
		}
		set
		{
			article previousValue = this._article.Entity;
			if (((previousValue != value) 
						|| (this._article.HasLoadedOrAssignedValue == false)))
			{
				this.SendPropertyChanging();
				if ((previousValue != null))
				{
					this._article.Entity = null;
					previousValue.CategoryArticleRelations.Remove(this);
				}
				this._article.Entity = value;
				if ((value != null))
				{
					value.CategoryArticleRelations.Add(this);
					this._article_id = value.article_id;
				}
				else
				{
					this._article_id = default(int);
				}
				this.SendPropertyChanged("article");
			}
		}
	}
	
	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_categories(category entity)
	{
		this.SendPropertyChanging();
		entity.CategoryArticleRelation = this;
	}
	
	private void detach_categories(category entity)
	{
		this.SendPropertyChanging();
		entity.CategoryArticleRelation = null;
	}
}

[Table(Name="dbo.categories")]
public partial class category : INotifyPropertyChanging, INotifyPropertyChanged
{
	
	private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
	
	private int _category_id;
	
	private string _title;
	
	private string _text;
	
	private string _color;
	
	private EntitySet<CategoryTestQuestionRelation> _CategoryTestQuestionRelations;
	
	private EntityRef<CategoryArticleRelation> _CategoryArticleRelation;
	
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void Oncategory_idChanging(int value);
    partial void Oncategory_idChanged();
    partial void OntitleChanging(string value);
    partial void OntitleChanged();
    partial void OntextChanging(string value);
    partial void OntextChanged();
    partial void OncolorChanging(string value);
    partial void OncolorChanged();
    #endregion
	
	public category()
	{
		this._CategoryTestQuestionRelations = new EntitySet<CategoryTestQuestionRelation>(new Action<CategoryTestQuestionRelation>(this.attach_CategoryTestQuestionRelations), new Action<CategoryTestQuestionRelation>(this.detach_CategoryTestQuestionRelations));
		this._CategoryArticleRelation = default(EntityRef<CategoryArticleRelation>);
		OnCreated();
	}
	
	[Column(Storage="_category_id", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
	public int category_id
	{
		get
		{
			return this._category_id;
		}
		set
		{
			if ((this._category_id != value))
			{
				if (this._CategoryArticleRelation.HasLoadedOrAssignedValue)
				{
					throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
				}
				this.Oncategory_idChanging(value);
				this.SendPropertyChanging();
				this._category_id = value;
				this.SendPropertyChanged("category_id");
				this.Oncategory_idChanged();
			}
		}
	}
	
	[Column(Storage="_title", DbType="VarChar(MAX) 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="_text", DbType="VarChar(MAX) 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();
			}
		}
	}
	
	[Column(Storage="_color", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
	public string color
	{
		get
		{
			return this._color;
		}
		set
		{
			if ((this._color != value))
			{
				this.OncolorChanging(value);
				this.SendPropertyChanging();
				this._color = value;
				this.SendPropertyChanged("color");
				this.OncolorChanged();
			}
		}
	}
	
	[Association(Name="category_CategoryTestQuestionRelation", Storage="_CategoryTestQuestionRelations", ThisKey="category_id", OtherKey="category_id")]
	public EntitySet<CategoryTestQuestionRelation> CategoryTestQuestionRelations
	{
		get
		{
			return this._CategoryTestQuestionRelations;
		}
		set
		{
			this._CategoryTestQuestionRelations.Assign(value);
		}
	}
	
	[Association(Name="CategoryArticleRelation_category", Storage="_CategoryArticleRelation", ThisKey="category_id", OtherKey="category_id", IsForeignKey=true)]
	public CategoryArticleRelation CategoryArticleRelation
	{
		get
		{
			return this._CategoryArticleRelation.Entity;
		}
		set
		{
			CategoryArticleRelation previousValue = this._CategoryArticleRelation.Entity;
			if (((previousValue != value) 
						|| (this._CategoryArticleRelation.HasLoadedOrAssignedValue == false)))
			{
				this.SendPropertyChanging();
				if ((previousValue != null))
				{
					this._CategoryArticleRelation.Entity = null;
					previousValue.categories.Remove(this);
				}
				this._CategoryArticleRelation.Entity = value;
				if ((value != null))
				{
					value.categories.Add(this);
					this._category_id = value.category_id;
				}
				else
				{
					this._category_id = default(int);
				}
				this.SendPropertyChanged("CategoryArticleRelation");
			}
		}
	}
	
	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_CategoryTestQuestionRelations(CategoryTestQuestionRelation entity)
	{
		this.SendPropertyChanging();
		entity.category = this;
	}
	
	private void detach_CategoryTestQuestionRelations(CategoryTestQuestionRelation entity)
	{
		this.SendPropertyChanging();
		entity.category = null;
	}
}

[Table(Name="dbo.aspnet_Users")]
public partial class aspnet_User : INotifyPropertyChanging, INotifyPropertyChanged
{
	
	private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
	
	private System.Guid _ApplicationId;
	
	private System.Guid _UserId;
	
	private string _UserName;
	
	private string _LoweredUserName;
	
	private string _MobileAlias;
	
	private bool _IsAnonymous;
	
	private System.DateTime _LastActivityDate;
	
	private EntityRef<article> _article;
	
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnApplicationIdChanging(System.Guid value);
    partial void OnApplicationIdChanged();
    partial void OnUserIdChanging(System.Guid value);
    partial void OnUserIdChanged();
    partial void OnUserNameChanging(string value);
    partial void OnUserNameChanged();
    partial void OnLoweredUserNameChanging(string value);
    partial void OnLoweredUserNameChanged();
    partial void OnMobileAliasChanging(string value);
    partial void OnMobileAliasChanged();
    partial void OnIsAnonymousChanging(bool value);
    partial void OnIsAnonymousChanged();
    partial void OnLastActivityDateChanging(System.DateTime value);
    partial void OnLastActivityDateChanged();
    #endregion
	
	public aspnet_User()
	{
		this._article = default(EntityRef<article>);
		OnCreated();
	}
	
	[Column(Storage="_ApplicationId", DbType="UniqueIdentifier NOT NULL")]
	public System.Guid ApplicationId
	{
		get
		{
			return this._ApplicationId;
		}
		set
		{
			if ((this._ApplicationId != value))
			{
				this.OnApplicationIdChanging(value);
				this.SendPropertyChanging();
				this._ApplicationId = value;
				this.SendPropertyChanged("ApplicationId");
				this.OnApplicationIdChanged();
			}
		}
	}
	
	[Column(Storage="_UserId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
	public System.Guid UserId
	{
		get
		{
			return this._UserId;
		}
		set
		{
			if ((this._UserId != value))
			{
				this.OnUserIdChanging(value);
				this.SendPropertyChanging();
				this._UserId = value;
				this.SendPropertyChanged("UserId");
				this.OnUserIdChanged();
			}
		}
	}
	
	[Column(Storage="_UserName", DbType="NVarChar(256) NOT NULL", CanBeNull=false)]
	public string UserName
	{
		get
		{
			return this._UserName;
		}
		set
		{
			if ((this._UserName != value))
			{
				if (this._article.HasLoadedOrAssignedValue)
				{
					throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
				}
				this.OnUserNameChanging(value);
				this.SendPropertyChanging();
				this._UserName = value;
				this.SendPropertyChanged("UserName");
				this.OnUserNameChanged();
			}
		}
	}
	
	[Column(Storage="_LoweredUserName", DbType="NVarChar(256) NOT NULL", CanBeNull=false)]
	public string LoweredUserName
	{
		get
		{
			return this._LoweredUserName;
		}
		set
		{
			if ((this._LoweredUserName != value))
			{
				this.OnLoweredUserNameChanging(value);
				this.SendPropertyChanging();
				this._LoweredUserName = value;
				this.SendPropertyChanged("LoweredUserName");
				this.OnLoweredUserNameChanged();
			}
		}
	}
	
	[Column(Storage="_MobileAlias", DbType="NVarChar(16)")]
	public string MobileAlias
	{
		get
		{
			return this._MobileAlias;
		}
		set
		{
			if ((this._MobileAlias != value))
			{
				this.OnMobileAliasChanging(value);
				this.SendPropertyChanging();
				this._MobileAlias = value;
				this.SendPropertyChanged("MobileAlias");
				this.OnMobileAliasChanged();
			}
		}
	}
	
	[Column(Storage="_IsAnonymous", DbType="Bit NOT NULL")]
	public bool IsAnonymous
	{
		get
		{
			return this._IsAnonymous;
		}
		set
		{
			if ((this._IsAnonymous != value))
			{
				this.OnIsAnonymousChanging(value);
				this.SendPropertyChanging();
				this._IsAnonymous = value;
				this.SendPropertyChanged("IsAnonymous");
				this.OnIsAnonymousChanged();
			}
		}
	}
	
	[Column(Storage="_LastActivityDate", DbType="DateTime NOT NULL")]
	public System.DateTime LastActivityDate
	{
		get
		{
			return this._LastActivityDate;
		}
		set
		{
			if ((this._LastActivityDate != value))
			{
				this.OnLastActivityDateChanging(value);
				this.SendPropertyChanging();
				this._LastActivityDate = value;
				this.SendPropertyChanged("LastActivityDate");
				this.OnLastActivityDateChanged();
			}
		}
	}
	
	[Association(Name="article_aspnet_User", Storage="_article", ThisKey="UserName", OtherKey="user_name", IsForeignKey=true)]
	public article article
	{
		get
		{
			return this._article.Entity;
		}
		set
		{
			article previousValue = this._article.Entity;
			if (((previousValue != value) 
						|| (this._article.HasLoadedOrAssignedValue == false)))
			{
				this.SendPropertyChanging();
				if ((previousValue != null))
				{
					this._article.Entity = null;
					previousValue.aspnet_Users.Remove(this);
				}
				this._article.Entity = value;
				if ((value != null))
				{
					value.aspnet_Users.Add(this);
					this._UserName = value.user_name;
				}
				else
				{
					this._UserName = default(string);
				}
				this.SendPropertyChanged("article");
			}
		}
	}
	
	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.articles")]
public partial class article : INotifyPropertyChanging, INotifyPropertyChanged
{
	
	private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
	
	private int _article_id;
	
	private string _title;
	
	private string _text;
	
	private string _user_name;
	
	private EntitySet<CategoryArticleRelation> _CategoryArticleRelations;
	
	private EntitySet<aspnet_User> _aspnet_Users;
	
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void Onarticle_idChanging(int value);
    partial void Onarticle_idChanged();
    partial void OntitleChanging(string value);
    partial void OntitleChanged();
    partial void OntextChanging(string value);
    partial void OntextChanged();
    partial void Onuser_nameChanging(string value);
    partial void Onuser_nameChanged();
    #endregion
	
	public article()
	{
		this._CategoryArticleRelations = new EntitySet<CategoryArticleRelation>(new Action<CategoryArticleRelation>(this.attach_CategoryArticleRelations), new Action<CategoryArticleRelation>(this.detach_CategoryArticleRelations));
		this._aspnet_Users = new EntitySet<aspnet_User>(new Action<aspnet_User>(this.attach_aspnet_Users), new Action<aspnet_User>(this.detach_aspnet_Users));
		OnCreated();
	}
	
	[Column(Storage="_article_id", DbType="Int NOT NULL", IsPrimaryKey=true)]
	public int article_id
	{
		get
		{
			return this._article_id;
		}
		set
		{
			if ((this._article_id != value))
			{
				this.Onarticle_idChanging(value);
				this.SendPropertyChanging();
				this._article_id = value;
				this.SendPropertyChanged("article_id");
				this.Onarticle_idChanged();
			}
		}
	}
	
	[Column(Storage="_title", DbType="VarChar(MAX) 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="_text", DbType="VarChar(MAX) 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();
			}
		}
	}
	
	[Column(Storage="_user_name", DbType="NVarChar(MAX) NOT NULL", CanBeNull=false)]
	public string user_name
	{
		get
		{
			return this._user_name;
		}
		set
		{
			if ((this._user_name != value))
			{
				this.Onuser_nameChanging(value);
				this.SendPropertyChanging();
				this._user_name = value;
				this.SendPropertyChanged("user_name");
				this.Onuser_nameChanged();
			}
		}
	}
	
	[Association(Name="article_CategoryArticleRelation", Storage="_CategoryArticleRelations", ThisKey="article_id", OtherKey="article_id")]
	public EntitySet<CategoryArticleRelation> CategoryArticleRelations
	{
		get
		{
			return this._CategoryArticleRelations;
		}
		set
		{
			this._CategoryArticleRelations.Assign(value);
		}
	}
	
	[Association(Name="article_aspnet_User", Storage="_aspnet_Users", ThisKey="user_name", OtherKey="UserName")]
	public EntitySet<aspnet_User> aspnet_Users
	{
		get
		{
			return this._aspnet_Users;
		}
		set
		{
			this._aspnet_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_CategoryArticleRelations(CategoryArticleRelation entity)
	{
		this.SendPropertyChanging();
		entity.article = this;
	}
	
	private void detach_CategoryArticleRelations(CategoryArticleRelation entity)
	{
		this.SendPropertyChanging();
		entity.article = null;
	}
	
	private void attach_aspnet_Users(aspnet_User entity)
	{
		this.SendPropertyChanging();
		entity.article = this;
	}
	
	private void detach_aspnet_Users(aspnet_User entity)
	{
		this.SendPropertyChanging();
		entity.article = null;
	}
}

[Table(Name="dbo.CategoryTestQuestionRelations")]
public partial class CategoryTestQuestionRelation : INotifyPropertyChanging, INotifyPropertyChanged
{
	
	private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
	
	private string _id;
	
	private int _category_id;
	
	private int _test_id;
	
	private int _question_id;
	
	private EntityRef<category> _category;
	
	private EntityRef<test> _test;
	
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnidChanging(string value);
    partial void OnidChanged();
    partial void Oncategory_idChanging(int value);
    partial void Oncategory_idChanged();
    partial void Ontest_idChanging(int value);
    partial void Ontest_idChanged();
    partial void Onquestion_idChanging(int value);
    partial void Onquestion_idChanged();
    #endregion
	
	public CategoryTestQuestionRelation()
	{
		this._category = default(EntityRef<category>);
		this._test = default(EntityRef<test>);
		OnCreated();
	}
	
	[Column(Storage="_id", DbType="NChar(10) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
	public string id
	{
		get
		{
			return this._id;
		}
		set
		{
			if ((this._id != value))
			{
				this.OnidChanging(value);
				this.SendPropertyChanging();
				this._id = value;
				this.SendPropertyChanged("id");
				this.OnidChanged();
			}
		}
	}
	
	[Column(Storage="_category_id", DbType="Int NOT NULL")]
	public int category_id
	{
		get
		{
			return this._category_id;
		}
		set
		{
			if ((this._category_id != value))
			{
				if (this._category.HasLoadedOrAssignedValue)
				{
					throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
				}
				this.Oncategory_idChanging(value);
				this.SendPropertyChanging();
				this._category_id = value;
				this.SendPropertyChanged("category_id");
				this.Oncategory_idChanged();
			}
		}
	}
	
	[Column(Storage="_test_id", DbType="Int NOT NULL")]
	public int test_id
	{
		get
		{
			return this._test_id;
		}
		set
		{
			if ((this._test_id != value))
			{
				if (this._test.HasLoadedOrAssignedValue)
				{
					throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
				}
				this.Ontest_idChanging(value);
				this.SendPropertyChanging();
				this._test_id = value;
				this.SendPropertyChanged("test_id");
				this.Ontest_idChanged();
			}
		}
	}
	
	[Column(Storage="_question_id", DbType="Int NOT NULL")]
	public int question_id
	{
		get
		{
			return this._question_id;
		}
		set
		{
			if ((this._question_id != value))
			{
				this.Onquestion_idChanging(value);
				this.SendPropertyChanging();
				this._question_id = value;
				this.SendPropertyChanged("question_id");
				this.Onquestion_idChanged();
			}
		}
	}
	
	[Association(Name="category_CategoryTestQuestionRelation", Storage="_category", ThisKey="category_id", OtherKey="category_id", IsForeignKey=true)]
	public category category
	{
		get
		{
			return this._category.Entity;
		}
		set
		{
			category previousValue = this._category.Entity;
			if (((previousValue != value) 
						|| (this._category.HasLoadedOrAssignedValue == false)))
			{
				this.SendPropertyChanging();
				if ((previousValue != null))
				{
					this._category.Entity = null;
					previousValue.CategoryTestQuestionRelations.Remove(this);
				}
				this._category.Entity = value;
				if ((value != null))
				{
					value.CategoryTestQuestionRelations.Add(this);
					this._category_id = value.category_id;
				}
				else
				{
					this._category_id = default(int);
				}
				this.SendPropertyChanged("category");
			}
		}
	}
	
	[Association(Name="test_CategoryTestQuestionRelation", Storage="_test", ThisKey="test_id", OtherKey="test_id", IsForeignKey=true)]
	public test test
	{
		get
		{
			return this._test.Entity;
		}
		set
		{
			test previousValue = this._test.Entity;
			if (((previousValue != value) 
						|| (this._test.HasLoadedOrAssignedValue == false)))
			{
				this.SendPropertyChanging();
				if ((previousValue != null))
				{
					this._test.Entity = null;
					previousValue.CategoryTestQuestionRelations.Remove(this);
				}
				this._test.Entity = value;
				if ((value != null))
				{
					value.CategoryTestQuestionRelations.Add(this);
					this._test_id = value.test_id;
				}
				else
				{
					this._test_id = default(int);
				}
				this.SendPropertyChanged("test");
			}
		}
	}
	
	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.news")]
public partial class @new : INotifyPropertyChanging, INotifyPropertyChanged
{
	
	private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
	
	private int _new_id;
	
	private System.DateTime _created;
	
	private string _title;
	
	private string _text;
	
	private string _user_name;
	
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void Onnew_idChanging(int value);
    partial void Onnew_idChanged();
    partial void OncreatedChanging(System.DateTime value);
    partial void OncreatedChanged();
    partial void OntitleChanging(string value);
    partial void OntitleChanged();
    partial void OntextChanging(string value);
    partial void OntextChanged();
    partial void Onuser_nameChanging(string value);
    partial void Onuser_nameChanged();
    #endregion
	
	public @new()
	{
		OnCreated();
	}
	
	[Column(Storage="_new_id", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
	public int new_id
	{
		get
		{
			return this._new_id;
		}
		set
		{
			if ((this._new_id != value))
			{
				this.Onnew_idChanging(value);
				this.SendPropertyChanging();
				this._new_id = value;
				this.SendPropertyChanged("new_id");
				this.Onnew_idChanged();
			}
		}
	}
	
	[Column(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();
			}
		}
	}
	
	[Column(Storage="_title", DbType="NVarChar(50) 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="_text", DbType="NVarChar(MAX) 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();
			}
		}
	}
	
	[Column(Storage="_user_name", DbType="NVarChar(MAX) NOT NULL", CanBeNull=false)]
	public string user_name
	{
		get
		{
			return this._user_name;
		}
		set
		{
			if ((this._user_name != value))
			{
				this.Onuser_nameChanging(value);
				this.SendPropertyChanging();
				this._user_name = value;
				this.SendPropertyChanged("user_name");
				this.Onuser_nameChanged();
			}
		}
	}
	
	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.tests")]
public partial class test : INotifyPropertyChanging, INotifyPropertyChanged
{
	
	private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
	
	private int _test_id;
	
	private string _title;
	
	private string _test1;
	
	private string _links;
	
	private string _user_name;
	
	private EntitySet<CategoryTestQuestionRelation> _CategoryTestQuestionRelations;
	
	private EntityRef<test> _test3;
	
	private EntityRef<test> _test2;
	
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void Ontest_idChanging(int value);
    partial void Ontest_idChanged();
    partial void OntitleChanging(string value);
    partial void OntitleChanged();
    partial void Ontest1Changing(string value);
    partial void Ontest1Changed();
    partial void OnlinksChanging(string value);
    partial void OnlinksChanged();
    partial void Onuser_nameChanging(string value);
    partial void Onuser_nameChanged();
    #endregion
	
	public test()
	{
		this._CategoryTestQuestionRelations = new EntitySet<CategoryTestQuestionRelation>(new Action<CategoryTestQuestionRelation>(this.attach_CategoryTestQuestionRelations), new Action<CategoryTestQuestionRelation>(this.detach_CategoryTestQuestionRelations));
		this._test3 = default(EntityRef<test>);
		this._test2 = default(EntityRef<test>);
		OnCreated();
	}
	
	[Column(Storage="_test_id", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
	public int test_id
	{
		get
		{
			return this._test_id;
		}
		set
		{
			if ((this._test_id != value))
			{
				if (this._test2.HasLoadedOrAssignedValue)
				{
					throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
				}
				this.Ontest_idChanging(value);
				this.SendPropertyChanging();
				this._test_id = value;
				this.SendPropertyChanged("test_id");
				this.Ontest_idChanged();
			}
		}
	}
	
	[Column(Storage="_title", DbType="VarChar(MAX) 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(Name="test", Storage="_test1", DbType="VarChar(MAX) NOT NULL", CanBeNull=false)]
	public string test1
	{
		get
		{
			return this._test1;
		}
		set
		{
			if ((this._test1 != value))
			{
				this.Ontest1Changing(value);
				this.SendPropertyChanging();
				this._test1 = value;
				this.SendPropertyChanged("test1");
				this.Ontest1Changed();
			}
		}
	}
	
	[Column(Storage="_links", DbType="VarChar(MAX)")]
	public string links
	{
		get
		{
			return this._links;
		}
		set
		{
			if ((this._links != value))
			{
				this.OnlinksChanging(value);
				this.SendPropertyChanging();
				this._links = value;
				this.SendPropertyChanged("links");
				this.OnlinksChanged();
			}
		}
	}
	
	[Column(Storage="_user_name", DbType="NVarChar(MAX)")]
	public string user_name
	{
		get
		{
			return this._user_name;
		}
		set
		{
			if ((this._user_name != value))
			{
				this.Onuser_nameChanging(value);
				this.SendPropertyChanging();
				this._user_name = value;
				this.SendPropertyChanged("user_name");
				this.Onuser_nameChanged();
			}
		}
	}
	
	[Association(Name="test_CategoryTestQuestionRelation", Storage="_CategoryTestQuestionRelations", ThisKey="test_id", OtherKey="test_id")]
	public EntitySet<CategoryTestQuestionRelation> CategoryTestQuestionRelations
	{
		get
		{
			return this._CategoryTestQuestionRelations;
		}
		set
		{
			this._CategoryTestQuestionRelations.Assign(value);
		}
	}
	
	[Association(Name="test_test", Storage="_test3", ThisKey="test_id", OtherKey="test_id", IsUnique=true, IsForeignKey=false)]
	public test test3
	{
		get
		{
			return this._test3.Entity;
		}
		set
		{
			test previousValue = this._test3.Entity;
			if (((previousValue != value) 
						|| (this._test3.HasLoadedOrAssignedValue == false)))
			{
				this.SendPropertyChanging();
				if ((previousValue != null))
				{
					this._test3.Entity = null;
					previousValue.test2 = null;
				}
				this._test3.Entity = value;
				if ((value != null))
				{
					value.test2 = this;
				}
				this.SendPropertyChanged("test3");
			}
		}
	}
	
	[Association(Name="test_test", Storage="_test2", ThisKey="test_id", OtherKey="test_id", IsForeignKey=true)]
	public test test2
	{
		get
		{
			return this._test2.Entity;
		}
		set
		{
			test previousValue = this._test2.Entity;
			if (((previousValue != value) 
						|| (this._test2.HasLoadedOrAssignedValue == false)))
			{
				this.SendPropertyChanging();
				if ((previousValue != null))
				{
					this._test2.Entity = null;
					previousValue.test3 = null;
				}
				this._test2.Entity = value;
				if ((value != null))
				{
					value.test3 = this;
					this._test_id = value.test_id;
				}
				else
				{
					this._test_id = default(int);
				}
				this.SendPropertyChanged("test2");
			}
		}
	}
	
	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_CategoryTestQuestionRelations(CategoryTestQuestionRelation entity)
	{
		this.SendPropertyChanging();
		entity.test = this;
	}
	
	private void detach_CategoryTestQuestionRelations(CategoryTestQuestionRelation entity)
	{
		this.SendPropertyChanging();
		entity.test = null;
	}
}

[Table(Name="dbo.comments")]
public partial class comment : INotifyPropertyChanging, INotifyPropertyChanged
{
	
	private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
	
	private int _comment_id;
	
	private string _title;
	
	private string _text;
	
	private int _off_set;
	
	private string _user_name;
	
	private string _parrent_type;
	
	private int _parrent_id;
	
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void Oncomment_idChanging(int value);
    partial void Oncomment_idChanged();
    partial void OntitleChanging(string value);
    partial void OntitleChanged();
    partial void OntextChanging(string value);
    partial void OntextChanged();
    partial void Onoff_setChanging(int value);
    partial void Onoff_setChanged();
    partial void Onuser_nameChanging(string value);
    partial void Onuser_nameChanged();
    partial void Onparrent_typeChanging(string value);
    partial void Onparrent_typeChanged();
    partial void Onparrent_idChanging(int value);
    partial void Onparrent_idChanged();
    #endregion
	
	public comment()
	{
		OnCreated();
	}
	
	[Column(Storage="_comment_id", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
	public int comment_id
	{
		get
		{
			return this._comment_id;
		}
		set
		{
			if ((this._comment_id != value))
			{
				this.Oncomment_idChanging(value);
				this.SendPropertyChanging();
				this._comment_id = value;
				this.SendPropertyChanged("comment_id");
				this.Oncomment_idChanged();
			}
		}
	}
	
	[Column(Storage="_title", DbType="VarChar(50) 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="_text", DbType="VarChar(MAX) 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();
			}
		}
	}
	
	[Column(Storage="_off_set", DbType="Int NOT NULL")]
	public int off_set
	{
		get
		{
			return this._off_set;
		}
		set
		{
			if ((this._off_set != value))
			{
				this.Onoff_setChanging(value);
				this.SendPropertyChanging();
				this._off_set = value;
				this.SendPropertyChanged("off_set");
				this.Onoff_setChanged();
			}
		}
	}
	
	[Column(Storage="_user_name", DbType="NVarChar(MAX) NOT NULL", CanBeNull=false)]
	public string user_name
	{
		get
		{
			return this._user_name;
		}
		set
		{
			if ((this._user_name != value))
			{
				this.Onuser_nameChanging(value);
				this.SendPropertyChanging();
				this._user_name = value;
				this.SendPropertyChanged("user_name");
				this.Onuser_nameChanged();
			}
		}
	}
	
	[Column(Storage="_parrent_type", DbType="VarChar(50) NOT NULL", CanBeNull=false)]
	public string parrent_type
	{
		get
		{
			return this._parrent_type;
		}
		set
		{
			if ((this._parrent_type != value))
			{
				this.Onparrent_typeChanging(value);
				this.SendPropertyChanging();
				this._parrent_type = value;
				this.SendPropertyChanged("parrent_type");
				this.Onparrent_typeChanged();
			}
		}
	}
	
	[Column(Storage="_parrent_id", DbType="Int NOT NULL")]
	public int parrent_id
	{
		get
		{
			return this._parrent_id;
		}
		set
		{
			if ((this._parrent_id != value))
			{
				this.Onparrent_idChanging(value);
				this.SendPropertyChanging();
				this._parrent_id = value;
				this.SendPropertyChanged("parrent_id");
				this.Onparrent_idChanged();
			}
		}
	}
	
	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.photos")]
public partial class photo : INotifyPropertyChanging, INotifyPropertyChanged
{
	
	private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
	
	private int _photo_id;
	
	private string _name;
	
	private string _type;
	
	private string _user_name;
	
	private string _path;
	
	private EntityRef<photo> _photo2;
	
	private EntityRef<photo> _photo1;
	
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void Onphoto_idChanging(int value);
    partial void Onphoto_idChanged();
    partial void OnnameChanging(string value);
    partial void OnnameChanged();
    partial void OntypeChanging(string value);
    partial void OntypeChanged();
    partial void Onuser_nameChanging(string value);
    partial void Onuser_nameChanged();
    partial void OnpathChanging(string value);
    partial void OnpathChanged();
    #endregion
	
	public photo()
	{
		this._photo2 = default(EntityRef<photo>);
		this._photo1 = default(EntityRef<photo>);
		OnCreated();
	}
	
	[Column(Storage="_photo_id", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
	public int photo_id
	{
		get
		{
			return this._photo_id;
		}
		set
		{
			if ((this._photo_id != value))
			{
				if (this._photo1.HasLoadedOrAssignedValue)
				{
					throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
				}
				this.Onphoto_idChanging(value);
				this.SendPropertyChanging();
				this._photo_id = value;
				this.SendPropertyChanged("photo_id");
				this.Onphoto_idChanged();
			}
		}
	}
	
	[Column(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();
			}
		}
	}
	
	[Column(Storage="_type", DbType="VarChar(50) NOT NULL", CanBeNull=false)]
	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();
			}
		}
	}
	
	[Column(Storage="_user_name", DbType="NVarChar(MAX) NOT NULL", CanBeNull=false)]
	public string user_name
	{
		get
		{
			return this._user_name;
		}
		set
		{
			if ((this._user_name != value))
			{
				this.Onuser_nameChanging(value);
				this.SendPropertyChanging();
				this._user_name = value;
				this.SendPropertyChanged("user_name");
				this.Onuser_nameChanged();
			}
		}
	}
	
	[Column(Storage="_path", DbType="NVarChar(MAX) NOT NULL", CanBeNull=false)]
	public string path
	{
		get
		{
			return this._path;
		}
		set
		{
			if ((this._path != value))
			{
				this.OnpathChanging(value);
				this.SendPropertyChanging();
				this._path = value;
				this.SendPropertyChanged("path");
				this.OnpathChanged();
			}
		}
	}
	
	[Association(Name="photo_photo", Storage="_photo2", ThisKey="photo_id", OtherKey="photo_id", IsUnique=true, IsForeignKey=false)]
	public photo photo2
	{
		get
		{
			return this._photo2.Entity;
		}
		set
		{
			photo previousValue = this._photo2.Entity;
			if (((previousValue != value) 
						|| (this._photo2.HasLoadedOrAssignedValue == false)))
			{
				this.SendPropertyChanging();
				if ((previousValue != null))
				{
					this._photo2.Entity = null;
					previousValue.photo1 = null;
				}
				this._photo2.Entity = value;
				if ((value != null))
				{
					value.photo1 = this;
				}
				this.SendPropertyChanged("photo2");
			}
		}
	}
	
	[Association(Name="photo_photo", Storage="_photo1", ThisKey="photo_id", OtherKey="photo_id", IsForeignKey=true)]
	public photo photo1
	{
		get
		{
			return this._photo1.Entity;
		}
		set
		{
			photo previousValue = this._photo1.Entity;
			if (((previousValue != value) 
						|| (this._photo1.HasLoadedOrAssignedValue == false)))
			{
				this.SendPropertyChanging();
				if ((previousValue != null))
				{
					this._photo1.Entity = null;
					previousValue.photo2 = null;
				}
				this._photo1.Entity = value;
				if ((value != null))
				{
					value.photo2 = this;
					this._photo_id = value.photo_id;
				}
				else
				{
					this._photo_id = default(int);
				}
				this.SendPropertyChanged("photo1");
			}
		}
	}
	
	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
