#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.3053
//
//     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="Northwind")]
public partial class DataClassesDataContext : System.Data.Linq.DataContext
{
	
	private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
	
  #region Extensibility Method Definitions
  partial void OnCreated();
  partial void InsertOrder(Order instance);
  partial void UpdateOrder(Order instance);
  partial void DeleteOrder(Order instance);
  partial void InsertOrder_Detail(Order_Detail instance);
  partial void UpdateOrder_Detail(Order_Detail instance);
  partial void DeleteOrder_Detail(Order_Detail instance);
  partial void InsertCustomer(Customer instance);
  partial void UpdateCustomer(Customer instance);
  partial void DeleteCustomer(Customer instance);
  partial void InsertEmployee(Employee instance);
  partial void UpdateEmployee(Employee instance);
  partial void DeleteEmployee(Employee instance);
  #endregion
	
	public DataClassesDataContext() : 
			base(global::System.Configuration.ConfigurationManager.ConnectionStrings["NorthwindConnectionString1"].ConnectionString, mappingSource)
	{
		OnCreated();
	}
	
	public DataClassesDataContext(string connection) : 
			base(connection, mappingSource)
	{
		OnCreated();
	}
	
	public DataClassesDataContext(System.Data.IDbConnection connection) : 
			base(connection, mappingSource)
	{
		OnCreated();
	}
	
	public DataClassesDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
			base(connection, mappingSource)
	{
		OnCreated();
	}
	
	public DataClassesDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
			base(connection, mappingSource)
	{
		OnCreated();
	}
	
	public System.Data.Linq.Table<Order> Orders
	{
		get
		{
			return this.GetTable<Order>();
		}
	}
	
	public System.Data.Linq.Table<Order_Detail> Order_Details
	{
		get
		{
			return this.GetTable<Order_Detail>();
		}
	}
	
	public System.Data.Linq.Table<Customer> Customers
	{
		get
		{
			return this.GetTable<Customer>();
		}
	}
	
	public System.Data.Linq.Table<Employee> Employees
	{
		get
		{
			return this.GetTable<Employee>();
		}
	}
}

[Table(Name="dbo.Orders")]
public partial class Order : INotifyPropertyChanging, INotifyPropertyChanged
{
	
	private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
	
	private int _OrderID;
	
	private string _CustomerID;
	
	private System.Nullable<int> _EmployeeID;
	
	private System.Nullable<System.DateTime> _OrderDate;
	
	private System.Nullable<System.DateTime> _RequiredDate;
	
	private System.Nullable<System.DateTime> _ShippedDate;
	
	private System.Nullable<int> _ShipVia;
	
	private System.Nullable<decimal> _Freight;
	
	private string _ShipName;
	
	private string _ShipAddress;
	
	private string _ShipCity;
	
	private string _ShipRegion;
	
	private string _ShipPostalCode;
	
	private string _ShipCountry;
	
	private EntitySet<Order_Detail> _Order_Details;
	
	private EntityRef<Customer> _Customer;
	
	private EntityRef<Employee> _Employee;
	
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnOrderIDChanging(int value);
    partial void OnOrderIDChanged();
    partial void OnCustomerIDChanging(string value);
    partial void OnCustomerIDChanged();
    partial void OnEmployeeIDChanging(System.Nullable<int> value);
    partial void OnEmployeeIDChanged();
    partial void OnOrderDateChanging(System.Nullable<System.DateTime> value);
    partial void OnOrderDateChanged();
    partial void OnRequiredDateChanging(System.Nullable<System.DateTime> value);
    partial void OnRequiredDateChanged();
    partial void OnShippedDateChanging(System.Nullable<System.DateTime> value);
    partial void OnShippedDateChanged();
    partial void OnShipViaChanging(System.Nullable<int> value);
    partial void OnShipViaChanged();
    partial void OnFreightChanging(System.Nullable<decimal> value);
    partial void OnFreightChanged();
    partial void OnShipNameChanging(string value);
    partial void OnShipNameChanged();
    partial void OnShipAddressChanging(string value);
    partial void OnShipAddressChanged();
    partial void OnShipCityChanging(string value);
    partial void OnShipCityChanged();
    partial void OnShipRegionChanging(string value);
    partial void OnShipRegionChanged();
    partial void OnShipPostalCodeChanging(string value);
    partial void OnShipPostalCodeChanged();
    partial void OnShipCountryChanging(string value);
    partial void OnShipCountryChanged();
    #endregion
	
	public Order()
	{
		this._Order_Details = new EntitySet<Order_Detail>(new Action<Order_Detail>(this.attach_Order_Details), new Action<Order_Detail>(this.detach_Order_Details));
		this._Customer = default(EntityRef<Customer>);
		this._Employee = default(EntityRef<Employee>);
		OnCreated();
	}
	
	[Column(Storage="_OrderID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
	public int OrderID
	{
		get
		{
			return this._OrderID;
		}
		set
		{
			if ((this._OrderID != value))
			{
				this.OnOrderIDChanging(value);
				this.SendPropertyChanging();
				this._OrderID = value;
				this.SendPropertyChanged("OrderID");
				this.OnOrderIDChanged();
			}
		}
	}
	
	[Column(Storage="_CustomerID", DbType="NChar(5)")]
	public string CustomerID
	{
		get
		{
			return this._CustomerID;
		}
		set
		{
			if ((this._CustomerID != value))
			{
				if (this._Customer.HasLoadedOrAssignedValue)
				{
					throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
				}
				this.OnCustomerIDChanging(value);
				this.SendPropertyChanging();
				this._CustomerID = value;
				this.SendPropertyChanged("CustomerID");
				this.OnCustomerIDChanged();
			}
		}
	}
	
	[Column(Storage="_EmployeeID", DbType="Int")]
	public System.Nullable<int> EmployeeID
	{
		get
		{
			return this._EmployeeID;
		}
		set
		{
			if ((this._EmployeeID != value))
			{
				if (this._Employee.HasLoadedOrAssignedValue)
				{
					throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
				}
				this.OnEmployeeIDChanging(value);
				this.SendPropertyChanging();
				this._EmployeeID = value;
				this.SendPropertyChanged("EmployeeID");
				this.OnEmployeeIDChanged();
			}
		}
	}
	
	[Column(Storage="_OrderDate", DbType="DateTime")]
	public System.Nullable<System.DateTime> OrderDate
	{
		get
		{
			return this._OrderDate;
		}
		set
		{
			if ((this._OrderDate != value))
			{
				this.OnOrderDateChanging(value);
				this.SendPropertyChanging();
				this._OrderDate = value;
				this.SendPropertyChanged("OrderDate");
				this.OnOrderDateChanged();
			}
		}
	}
	
	[Column(Storage="_RequiredDate", DbType="DateTime")]
	public System.Nullable<System.DateTime> RequiredDate
	{
		get
		{
			return this._RequiredDate;
		}
		set
		{
			if ((this._RequiredDate != value))
			{
				this.OnRequiredDateChanging(value);
				this.SendPropertyChanging();
				this._RequiredDate = value;
				this.SendPropertyChanged("RequiredDate");
				this.OnRequiredDateChanged();
			}
		}
	}
	
	[Column(Storage="_ShippedDate", DbType="DateTime")]
	public System.Nullable<System.DateTime> ShippedDate
	{
		get
		{
			return this._ShippedDate;
		}
		set
		{
			if ((this._ShippedDate != value))
			{
				this.OnShippedDateChanging(value);
				this.SendPropertyChanging();
				this._ShippedDate = value;
				this.SendPropertyChanged("ShippedDate");
				this.OnShippedDateChanged();
			}
		}
	}
	
	[Column(Storage="_ShipVia", DbType="Int")]
	public System.Nullable<int> ShipVia
	{
		get
		{
			return this._ShipVia;
		}
		set
		{
			if ((this._ShipVia != value))
			{
				this.OnShipViaChanging(value);
				this.SendPropertyChanging();
				this._ShipVia = value;
				this.SendPropertyChanged("ShipVia");
				this.OnShipViaChanged();
			}
		}
	}
	
	[Column(Storage="_Freight", DbType="Decimal(6,2)")]
	public System.Nullable<decimal> Freight
	{
		get
		{
			return this._Freight;
		}
		set
		{
			if ((this._Freight != value))
			{
				this.OnFreightChanging(value);
				this.SendPropertyChanging();
				this._Freight = value;
				this.SendPropertyChanged("Freight");
				this.OnFreightChanged();
			}
		}
	}
	
	[Column(Storage="_ShipName", DbType="NVarChar(40)")]
	public string ShipName
	{
		get
		{
			return this._ShipName;
		}
		set
		{
			if ((this._ShipName != value))
			{
				this.OnShipNameChanging(value);
				this.SendPropertyChanging();
				this._ShipName = value;
				this.SendPropertyChanged("ShipName");
				this.OnShipNameChanged();
			}
		}
	}
	
	[Column(Storage="_ShipAddress", DbType="NVarChar(60)")]
	public string ShipAddress
	{
		get
		{
			return this._ShipAddress;
		}
		set
		{
			if ((this._ShipAddress != value))
			{
				this.OnShipAddressChanging(value);
				this.SendPropertyChanging();
				this._ShipAddress = value;
				this.SendPropertyChanged("ShipAddress");
				this.OnShipAddressChanged();
			}
		}
	}
	
	[Column(Storage="_ShipCity", DbType="NVarChar(15)")]
	public string ShipCity
	{
		get
		{
			return this._ShipCity;
		}
		set
		{
			if ((this._ShipCity != value))
			{
				this.OnShipCityChanging(value);
				this.SendPropertyChanging();
				this._ShipCity = value;
				this.SendPropertyChanged("ShipCity");
				this.OnShipCityChanged();
			}
		}
	}
	
	[Column(Storage="_ShipRegion", DbType="NVarChar(15)")]
	public string ShipRegion
	{
		get
		{
			return this._ShipRegion;
		}
		set
		{
			if ((this._ShipRegion != value))
			{
				this.OnShipRegionChanging(value);
				this.SendPropertyChanging();
				this._ShipRegion = value;
				this.SendPropertyChanged("ShipRegion");
				this.OnShipRegionChanged();
			}
		}
	}
	
	[Column(Storage="_ShipPostalCode", DbType="NVarChar(10)")]
	public string ShipPostalCode
	{
		get
		{
			return this._ShipPostalCode;
		}
		set
		{
			if ((this._ShipPostalCode != value))
			{
				this.OnShipPostalCodeChanging(value);
				this.SendPropertyChanging();
				this._ShipPostalCode = value;
				this.SendPropertyChanged("ShipPostalCode");
				this.OnShipPostalCodeChanged();
			}
		}
	}
	
	[Column(Storage="_ShipCountry", DbType="NVarChar(15)")]
	public string ShipCountry
	{
		get
		{
			return this._ShipCountry;
		}
		set
		{
			if ((this._ShipCountry != value))
			{
				this.OnShipCountryChanging(value);
				this.SendPropertyChanging();
				this._ShipCountry = value;
				this.SendPropertyChanged("ShipCountry");
				this.OnShipCountryChanged();
			}
		}
	}
	
	[Association(Name="Order_Order_Detail", Storage="_Order_Details", ThisKey="OrderID", OtherKey="OrderID")]
	public EntitySet<Order_Detail> Order_Details
	{
		get
		{
			return this._Order_Details;
		}
		set
		{
			this._Order_Details.Assign(value);
		}
	}
	
	[Association(Name="Customer_Order", Storage="_Customer", ThisKey="CustomerID", OtherKey="CustomerID", IsForeignKey=true)]
	public Customer Customer
	{
		get
		{
			return this._Customer.Entity;
		}
		set
		{
			Customer previousValue = this._Customer.Entity;
			if (((previousValue != value) 
						|| (this._Customer.HasLoadedOrAssignedValue == false)))
			{
				this.SendPropertyChanging();
				if ((previousValue != null))
				{
					this._Customer.Entity = null;
					previousValue.Orders.Remove(this);
				}
				this._Customer.Entity = value;
				if ((value != null))
				{
					value.Orders.Add(this);
					this._CustomerID = value.CustomerID;
				}
				else
				{
					this._CustomerID = default(string);
				}
				this.SendPropertyChanged("Customer");
			}
		}
	}
	
	[Association(Name="Employee_Order", Storage="_Employee", ThisKey="EmployeeID", OtherKey="EmployeeID", IsForeignKey=true)]
	public Employee Employee
	{
		get
		{
			return this._Employee.Entity;
		}
		set
		{
			Employee previousValue = this._Employee.Entity;
			if (((previousValue != value) 
						|| (this._Employee.HasLoadedOrAssignedValue == false)))
			{
				this.SendPropertyChanging();
				if ((previousValue != null))
				{
					this._Employee.Entity = null;
					previousValue.Orders.Remove(this);
				}
				this._Employee.Entity = value;
				if ((value != null))
				{
					value.Orders.Add(this);
					this._EmployeeID = value.EmployeeID;
				}
				else
				{
					this._EmployeeID = default(Nullable<int>);
				}
				this.SendPropertyChanged("Employee");
			}
		}
	}
	
	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_Order_Details(Order_Detail entity)
	{
		this.SendPropertyChanging();
		entity.Order = this;
	}
	
	private void detach_Order_Details(Order_Detail entity)
	{
		this.SendPropertyChanging();
		entity.Order = null;
	}
}

[Table(Name="dbo.[Order Details]")]
public partial class Order_Detail : INotifyPropertyChanging, INotifyPropertyChanged
{
	
	private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
	
	private int _OrderID;
	
	private int _ProductID;
	
	private decimal _UnitPrice;
	
	private short _Quantity;
	
	private float _Discount;
	
	private EntityRef<Order> _Order;
	
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnOrderIDChanging(int value);
    partial void OnOrderIDChanged();
    partial void OnProductIDChanging(int value);
    partial void OnProductIDChanged();
    partial void OnUnitPriceChanging(decimal value);
    partial void OnUnitPriceChanged();
    partial void OnQuantityChanging(short value);
    partial void OnQuantityChanged();
    partial void OnDiscountChanging(float value);
    partial void OnDiscountChanged();
    #endregion
	
	public Order_Detail()
	{
		this._Order = default(EntityRef<Order>);
		OnCreated();
	}
	
	[Column(Storage="_OrderID", DbType="Int NOT NULL", IsPrimaryKey=true)]
	public int OrderID
	{
		get
		{
			return this._OrderID;
		}
		set
		{
			if ((this._OrderID != value))
			{
				if (this._Order.HasLoadedOrAssignedValue)
				{
					throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
				}
				this.OnOrderIDChanging(value);
				this.SendPropertyChanging();
				this._OrderID = value;
				this.SendPropertyChanged("OrderID");
				this.OnOrderIDChanged();
			}
		}
	}
	
	[Column(Storage="_ProductID", DbType="Int NOT NULL", IsPrimaryKey=true)]
	public int ProductID
	{
		get
		{
			return this._ProductID;
		}
		set
		{
			if ((this._ProductID != value))
			{
				this.OnProductIDChanging(value);
				this.SendPropertyChanging();
				this._ProductID = value;
				this.SendPropertyChanged("ProductID");
				this.OnProductIDChanged();
			}
		}
	}
	
	[Column(Storage="_UnitPrice", DbType="Decimal(5,2) NOT NULL")]
	public decimal UnitPrice
	{
		get
		{
			return this._UnitPrice;
		}
		set
		{
			if ((this._UnitPrice != value))
			{
				this.OnUnitPriceChanging(value);
				this.SendPropertyChanging();
				this._UnitPrice = value;
				this.SendPropertyChanged("UnitPrice");
				this.OnUnitPriceChanged();
			}
		}
	}
	
	[Column(Storage="_Quantity", DbType="SmallInt NOT NULL")]
	public short Quantity
	{
		get
		{
			return this._Quantity;
		}
		set
		{
			if ((this._Quantity != value))
			{
				this.OnQuantityChanging(value);
				this.SendPropertyChanging();
				this._Quantity = value;
				this.SendPropertyChanged("Quantity");
				this.OnQuantityChanged();
			}
		}
	}
	
	[Column(Storage="_Discount", DbType="Real NOT NULL")]
	public float Discount
	{
		get
		{
			return this._Discount;
		}
		set
		{
			if ((this._Discount != value))
			{
				this.OnDiscountChanging(value);
				this.SendPropertyChanging();
				this._Discount = value;
				this.SendPropertyChanged("Discount");
				this.OnDiscountChanged();
			}
		}
	}
	
	[Association(Name="Order_Order_Detail", Storage="_Order", ThisKey="OrderID", OtherKey="OrderID", IsForeignKey=true)]
	public Order Order
	{
		get
		{
			return this._Order.Entity;
		}
		set
		{
			Order previousValue = this._Order.Entity;
			if (((previousValue != value) 
						|| (this._Order.HasLoadedOrAssignedValue == false)))
			{
				this.SendPropertyChanging();
				if ((previousValue != null))
				{
					this._Order.Entity = null;
					previousValue.Order_Details.Remove(this);
				}
				this._Order.Entity = value;
				if ((value != null))
				{
					value.Order_Details.Add(this);
					this._OrderID = value.OrderID;
				}
				else
				{
					this._OrderID = default(int);
				}
				this.SendPropertyChanged("Order");
			}
		}
	}
	
	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.Customers")]
public partial class Customer : INotifyPropertyChanging, INotifyPropertyChanged
{
	
	private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
	
	private string _CustomerID;
	
	private string _CompanyName;
	
	private string _ContactName;
	
	private string _ContactTitle;
	
	private string _Address;
	
	private string _City;
	
	private string _Region;
	
	private string _PostalCode;
	
	private string _Country;
	
	private string _Phone;
	
	private string _Fax;
	
	private System.Nullable<bool> _Bool;
	
	private EntitySet<Order> _Orders;
	
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnCustomerIDChanging(string value);
    partial void OnCustomerIDChanged();
    partial void OnCompanyNameChanging(string value);
    partial void OnCompanyNameChanged();
    partial void OnContactNameChanging(string value);
    partial void OnContactNameChanged();
    partial void OnContactTitleChanging(string value);
    partial void OnContactTitleChanged();
    partial void OnAddressChanging(string value);
    partial void OnAddressChanged();
    partial void OnCityChanging(string value);
    partial void OnCityChanged();
    partial void OnRegionChanging(string value);
    partial void OnRegionChanged();
    partial void OnPostalCodeChanging(string value);
    partial void OnPostalCodeChanged();
    partial void OnCountryChanging(string value);
    partial void OnCountryChanged();
    partial void OnPhoneChanging(string value);
    partial void OnPhoneChanged();
    partial void OnFaxChanging(string value);
    partial void OnFaxChanged();
    partial void OnBoolChanging(System.Nullable<bool> value);
    partial void OnBoolChanged();
    #endregion
	
	public Customer()
	{
		this._Orders = new EntitySet<Order>(new Action<Order>(this.attach_Orders), new Action<Order>(this.detach_Orders));
		OnCreated();
	}
	
	[Column(Storage="_CustomerID", DbType="NChar(5) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
	public string CustomerID
	{
		get
		{
			return this._CustomerID;
		}
		set
		{
			if ((this._CustomerID != value))
			{
				this.OnCustomerIDChanging(value);
				this.SendPropertyChanging();
				this._CustomerID = value;
				this.SendPropertyChanged("CustomerID");
				this.OnCustomerIDChanged();
			}
		}
	}
	
	[Column(Storage="_CompanyName", DbType="NVarChar(40) NOT NULL", CanBeNull=false)]
	public string CompanyName
	{
		get
		{
			return this._CompanyName;
		}
		set
		{
			if ((this._CompanyName != value))
			{
				this.OnCompanyNameChanging(value);
				this.SendPropertyChanging();
				this._CompanyName = value;
				this.SendPropertyChanged("CompanyName");
				this.OnCompanyNameChanged();
			}
		}
	}
	
	[Column(Storage="_ContactName", DbType="NVarChar(30)")]
	public string ContactName
	{
		get
		{
			return this._ContactName;
		}
		set
		{
			if ((this._ContactName != value))
			{
				this.OnContactNameChanging(value);
				this.SendPropertyChanging();
				this._ContactName = value;
				this.SendPropertyChanged("ContactName");
				this.OnContactNameChanged();
			}
		}
	}
	
	[Column(Storage="_ContactTitle", DbType="NVarChar(30)")]
	public string ContactTitle
	{
		get
		{
			return this._ContactTitle;
		}
		set
		{
			if ((this._ContactTitle != value))
			{
				this.OnContactTitleChanging(value);
				this.SendPropertyChanging();
				this._ContactTitle = value;
				this.SendPropertyChanged("ContactTitle");
				this.OnContactTitleChanged();
			}
		}
	}
	
	[Column(Storage="_Address", DbType="NVarChar(60)")]
	public string Address
	{
		get
		{
			return this._Address;
		}
		set
		{
			if ((this._Address != value))
			{
				this.OnAddressChanging(value);
				this.SendPropertyChanging();
				this._Address = value;
				this.SendPropertyChanged("Address");
				this.OnAddressChanged();
			}
		}
	}
	
	[Column(Storage="_City", DbType="NVarChar(15)")]
	public string City
	{
		get
		{
			return this._City;
		}
		set
		{
			if ((this._City != value))
			{
				this.OnCityChanging(value);
				this.SendPropertyChanging();
				this._City = value;
				this.SendPropertyChanged("City");
				this.OnCityChanged();
			}
		}
	}
	
	[Column(Storage="_Region", DbType="NVarChar(15)")]
	public string Region
	{
		get
		{
			return this._Region;
		}
		set
		{
			if ((this._Region != value))
			{
				this.OnRegionChanging(value);
				this.SendPropertyChanging();
				this._Region = value;
				this.SendPropertyChanged("Region");
				this.OnRegionChanged();
			}
		}
	}
	
	[Column(Storage="_PostalCode", DbType="NVarChar(10)")]
	public string PostalCode
	{
		get
		{
			return this._PostalCode;
		}
		set
		{
			if ((this._PostalCode != value))
			{
				this.OnPostalCodeChanging(value);
				this.SendPropertyChanging();
				this._PostalCode = value;
				this.SendPropertyChanged("PostalCode");
				this.OnPostalCodeChanged();
			}
		}
	}
	
	[Column(Storage="_Country", DbType="NVarChar(15)")]
	public string Country
	{
		get
		{
			return this._Country;
		}
		set
		{
			if ((this._Country != value))
			{
				this.OnCountryChanging(value);
				this.SendPropertyChanging();
				this._Country = value;
				this.SendPropertyChanged("Country");
				this.OnCountryChanged();
			}
		}
	}
	
	[Column(Storage="_Phone", DbType="NVarChar(24)")]
	public string Phone
	{
		get
		{
			return this._Phone;
		}
		set
		{
			if ((this._Phone != value))
			{
				this.OnPhoneChanging(value);
				this.SendPropertyChanging();
				this._Phone = value;
				this.SendPropertyChanged("Phone");
				this.OnPhoneChanged();
			}
		}
	}
	
	[Column(Storage="_Fax", DbType="NVarChar(24)")]
	public string Fax
	{
		get
		{
			return this._Fax;
		}
		set
		{
			if ((this._Fax != value))
			{
				this.OnFaxChanging(value);
				this.SendPropertyChanging();
				this._Fax = value;
				this.SendPropertyChanged("Fax");
				this.OnFaxChanged();
			}
		}
	}
	
	[Column(Storage="_Bool", DbType="Bit")]
	public System.Nullable<bool> Bool
	{
		get
		{
			return this._Bool;
		}
		set
		{
			if ((this._Bool != value))
			{
				this.OnBoolChanging(value);
				this.SendPropertyChanging();
				this._Bool = value;
				this.SendPropertyChanged("Bool");
				this.OnBoolChanged();
			}
		}
	}
	
	[Association(Name="Customer_Order", Storage="_Orders", ThisKey="CustomerID", OtherKey="CustomerID")]
	public EntitySet<Order> Orders
	{
		get
		{
			return this._Orders;
		}
		set
		{
			this._Orders.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_Orders(Order entity)
	{
		this.SendPropertyChanging();
		entity.Customer = this;
	}
	
	private void detach_Orders(Order entity)
	{
		this.SendPropertyChanging();
		entity.Customer = null;
	}
}

[Table(Name="dbo.Employees")]
public partial class Employee : INotifyPropertyChanging, INotifyPropertyChanged
{
	
	private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
	
	private int _EmployeeID;
	
	private string _LastName;
	
	private string _FirstName;
	
	private string _Title;
	
	private string _TitleOfCourtesy;
	
	private System.Nullable<System.DateTime> _BirthDate;
	
	private System.Nullable<System.DateTime> _HireDate;
	
	private string _Address;
	
	private string _City;
	
	private string _Region;
	
	private string _PostalCode;
	
	private string _Country;
	
	private string _HomePhone;
	
	private string _Extension;
	
	private System.Data.Linq.Binary _Photo;
	
	private string _Notes;
	
	private System.Nullable<int> _ReportsTo;
	
	private string _PhotoPath;
	
	private EntitySet<Order> _Orders;
	
	private EntitySet<Employee> _Employees;
	
	private EntityRef<Employee> _Employee1;
	
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnEmployeeIDChanging(int value);
    partial void OnEmployeeIDChanged();
    partial void OnLastNameChanging(string value);
    partial void OnLastNameChanged();
    partial void OnFirstNameChanging(string value);
    partial void OnFirstNameChanged();
    partial void OnTitleChanging(string value);
    partial void OnTitleChanged();
    partial void OnTitleOfCourtesyChanging(string value);
    partial void OnTitleOfCourtesyChanged();
    partial void OnBirthDateChanging(System.Nullable<System.DateTime> value);
    partial void OnBirthDateChanged();
    partial void OnHireDateChanging(System.Nullable<System.DateTime> value);
    partial void OnHireDateChanged();
    partial void OnAddressChanging(string value);
    partial void OnAddressChanged();
    partial void OnCityChanging(string value);
    partial void OnCityChanged();
    partial void OnRegionChanging(string value);
    partial void OnRegionChanged();
    partial void OnPostalCodeChanging(string value);
    partial void OnPostalCodeChanged();
    partial void OnCountryChanging(string value);
    partial void OnCountryChanged();
    partial void OnHomePhoneChanging(string value);
    partial void OnHomePhoneChanged();
    partial void OnExtensionChanging(string value);
    partial void OnExtensionChanged();
    partial void OnPhotoChanging(System.Data.Linq.Binary value);
    partial void OnPhotoChanged();
    partial void OnNotesChanging(string value);
    partial void OnNotesChanged();
    partial void OnReportsToChanging(System.Nullable<int> value);
    partial void OnReportsToChanged();
    partial void OnPhotoPathChanging(string value);
    partial void OnPhotoPathChanged();
    #endregion
	
	public Employee()
	{
		this._Orders = new EntitySet<Order>(new Action<Order>(this.attach_Orders), new Action<Order>(this.detach_Orders));
		this._Employees = new EntitySet<Employee>(new Action<Employee>(this.attach_Employees), new Action<Employee>(this.detach_Employees));
		this._Employee1 = default(EntityRef<Employee>);
		OnCreated();
	}
	
	[Column(Storage="_EmployeeID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
	public int EmployeeID
	{
		get
		{
			return this._EmployeeID;
		}
		set
		{
			if ((this._EmployeeID != value))
			{
				this.OnEmployeeIDChanging(value);
				this.SendPropertyChanging();
				this._EmployeeID = value;
				this.SendPropertyChanged("EmployeeID");
				this.OnEmployeeIDChanged();
			}
		}
	}
	
	[Column(Storage="_LastName", DbType="NVarChar(20) NOT NULL", CanBeNull=false)]
	public string LastName
	{
		get
		{
			return this._LastName;
		}
		set
		{
			if ((this._LastName != value))
			{
				this.OnLastNameChanging(value);
				this.SendPropertyChanging();
				this._LastName = value;
				this.SendPropertyChanged("LastName");
				this.OnLastNameChanged();
			}
		}
	}
	
	[Column(Storage="_FirstName", DbType="NVarChar(10) NOT NULL", CanBeNull=false)]
	public string FirstName
	{
		get
		{
			return this._FirstName;
		}
		set
		{
			if ((this._FirstName != value))
			{
				this.OnFirstNameChanging(value);
				this.SendPropertyChanging();
				this._FirstName = value;
				this.SendPropertyChanged("FirstName");
				this.OnFirstNameChanged();
			}
		}
	}
	
	[Column(Storage="_Title", DbType="NVarChar(30)")]
	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="_TitleOfCourtesy", DbType="NVarChar(25)")]
	public string TitleOfCourtesy
	{
		get
		{
			return this._TitleOfCourtesy;
		}
		set
		{
			if ((this._TitleOfCourtesy != value))
			{
				this.OnTitleOfCourtesyChanging(value);
				this.SendPropertyChanging();
				this._TitleOfCourtesy = value;
				this.SendPropertyChanged("TitleOfCourtesy");
				this.OnTitleOfCourtesyChanged();
			}
		}
	}
	
	[Column(Storage="_BirthDate", DbType="DateTime")]
	public System.Nullable<System.DateTime> BirthDate
	{
		get
		{
			return this._BirthDate;
		}
		set
		{
			if ((this._BirthDate != value))
			{
				this.OnBirthDateChanging(value);
				this.SendPropertyChanging();
				this._BirthDate = value;
				this.SendPropertyChanged("BirthDate");
				this.OnBirthDateChanged();
			}
		}
	}
	
	[Column(Storage="_HireDate", DbType="DateTime")]
	public System.Nullable<System.DateTime> HireDate
	{
		get
		{
			return this._HireDate;
		}
		set
		{
			if ((this._HireDate != value))
			{
				this.OnHireDateChanging(value);
				this.SendPropertyChanging();
				this._HireDate = value;
				this.SendPropertyChanged("HireDate");
				this.OnHireDateChanged();
			}
		}
	}
	
	[Column(Storage="_Address", DbType="NVarChar(60)")]
	public string Address
	{
		get
		{
			return this._Address;
		}
		set
		{
			if ((this._Address != value))
			{
				this.OnAddressChanging(value);
				this.SendPropertyChanging();
				this._Address = value;
				this.SendPropertyChanged("Address");
				this.OnAddressChanged();
			}
		}
	}
	
	[Column(Storage="_City", DbType="NVarChar(15)")]
	public string City
	{
		get
		{
			return this._City;
		}
		set
		{
			if ((this._City != value))
			{
				this.OnCityChanging(value);
				this.SendPropertyChanging();
				this._City = value;
				this.SendPropertyChanged("City");
				this.OnCityChanged();
			}
		}
	}
	
	[Column(Storage="_Region", DbType="NVarChar(15)")]
	public string Region
	{
		get
		{
			return this._Region;
		}
		set
		{
			if ((this._Region != value))
			{
				this.OnRegionChanging(value);
				this.SendPropertyChanging();
				this._Region = value;
				this.SendPropertyChanged("Region");
				this.OnRegionChanged();
			}
		}
	}
	
	[Column(Storage="_PostalCode", DbType="NVarChar(10)")]
	public string PostalCode
	{
		get
		{
			return this._PostalCode;
		}
		set
		{
			if ((this._PostalCode != value))
			{
				this.OnPostalCodeChanging(value);
				this.SendPropertyChanging();
				this._PostalCode = value;
				this.SendPropertyChanged("PostalCode");
				this.OnPostalCodeChanged();
			}
		}
	}
	
	[Column(Storage="_Country", DbType="NVarChar(15)")]
	public string Country
	{
		get
		{
			return this._Country;
		}
		set
		{
			if ((this._Country != value))
			{
				this.OnCountryChanging(value);
				this.SendPropertyChanging();
				this._Country = value;
				this.SendPropertyChanged("Country");
				this.OnCountryChanged();
			}
		}
	}
	
	[Column(Storage="_HomePhone", DbType="NVarChar(24)")]
	public string HomePhone
	{
		get
		{
			return this._HomePhone;
		}
		set
		{
			if ((this._HomePhone != value))
			{
				this.OnHomePhoneChanging(value);
				this.SendPropertyChanging();
				this._HomePhone = value;
				this.SendPropertyChanged("HomePhone");
				this.OnHomePhoneChanged();
			}
		}
	}
	
	[Column(Storage="_Extension", DbType="NVarChar(4)")]
	public string Extension
	{
		get
		{
			return this._Extension;
		}
		set
		{
			if ((this._Extension != value))
			{
				this.OnExtensionChanging(value);
				this.SendPropertyChanging();
				this._Extension = value;
				this.SendPropertyChanged("Extension");
				this.OnExtensionChanged();
			}
		}
	}
	
	[Column(Storage="_Photo", DbType="Image", CanBeNull=true, UpdateCheck=UpdateCheck.Never)]
	public System.Data.Linq.Binary Photo
	{
		get
		{
			return this._Photo;
		}
		set
		{
			if ((this._Photo != value))
			{
				this.OnPhotoChanging(value);
				this.SendPropertyChanging();
				this._Photo = value;
				this.SendPropertyChanged("Photo");
				this.OnPhotoChanged();
			}
		}
	}
	
	[Column(Storage="_Notes", DbType="NText", UpdateCheck=UpdateCheck.Never)]
	public string Notes
	{
		get
		{
			return this._Notes;
		}
		set
		{
			if ((this._Notes != value))
			{
				this.OnNotesChanging(value);
				this.SendPropertyChanging();
				this._Notes = value;
				this.SendPropertyChanged("Notes");
				this.OnNotesChanged();
			}
		}
	}
	
	[Column(Storage="_ReportsTo", DbType="Int")]
	public System.Nullable<int> ReportsTo
	{
		get
		{
			return this._ReportsTo;
		}
		set
		{
			if ((this._ReportsTo != value))
			{
				if (this._Employee1.HasLoadedOrAssignedValue)
				{
					throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
				}
				this.OnReportsToChanging(value);
				this.SendPropertyChanging();
				this._ReportsTo = value;
				this.SendPropertyChanged("ReportsTo");
				this.OnReportsToChanged();
			}
		}
	}
	
	[Column(Storage="_PhotoPath", DbType="NVarChar(255)")]
	public string PhotoPath
	{
		get
		{
			return this._PhotoPath;
		}
		set
		{
			if ((this._PhotoPath != value))
			{
				this.OnPhotoPathChanging(value);
				this.SendPropertyChanging();
				this._PhotoPath = value;
				this.SendPropertyChanged("PhotoPath");
				this.OnPhotoPathChanged();
			}
		}
	}
	
	[Association(Name="Employee_Order", Storage="_Orders", ThisKey="EmployeeID", OtherKey="EmployeeID")]
	public EntitySet<Order> Orders
	{
		get
		{
			return this._Orders;
		}
		set
		{
			this._Orders.Assign(value);
		}
	}
	
	[Association(Name="Employee_Employee", Storage="_Employees", ThisKey="EmployeeID", OtherKey="ReportsTo")]
	public EntitySet<Employee> Employees
	{
		get
		{
			return this._Employees;
		}
		set
		{
			this._Employees.Assign(value);
		}
	}
	
	[Association(Name="Employee_Employee", Storage="_Employee1", ThisKey="ReportsTo", OtherKey="EmployeeID", IsForeignKey=true)]
	public Employee Employee1
	{
		get
		{
			return this._Employee1.Entity;
		}
		set
		{
			Employee previousValue = this._Employee1.Entity;
			if (((previousValue != value) 
						|| (this._Employee1.HasLoadedOrAssignedValue == false)))
			{
				this.SendPropertyChanging();
				if ((previousValue != null))
				{
					this._Employee1.Entity = null;
					previousValue.Employees.Remove(this);
				}
				this._Employee1.Entity = value;
				if ((value != null))
				{
					value.Employees.Add(this);
					this._ReportsTo = value.EmployeeID;
				}
				else
				{
					this._ReportsTo = default(Nullable<int>);
				}
				this.SendPropertyChanged("Employee1");
			}
		}
	}
	
	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_Orders(Order entity)
	{
		this.SendPropertyChanging();
		entity.Employee = this;
	}
	
	private void detach_Orders(Order entity)
	{
		this.SendPropertyChanging();
		entity.Employee = null;
	}
	
	private void attach_Employees(Employee entity)
	{
		this.SendPropertyChanging();
		entity.Employee1 = this;
	}
	
	private void detach_Employees(Employee entity)
	{
		this.SendPropertyChanging();
		entity.Employee1 = null;
	}
}
#pragma warning restore 1591
