#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.4927
//
//     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 NorthwindDataContext : System.Data.Linq.DataContext
{
	
	private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
	
  #region Extensibility Method Definitions
  partial void OnCreated();
  partial void InsertCustomer(Customer instance);
  partial void UpdateCustomer(Customer instance);
  partial void DeleteCustomer(Customer instance);
  #endregion
	
	public NorthwindDataContext() : 
			base(global::System.Configuration.ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].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<Customer> Customers
	{
		get
		{
			return this.GetTable<Customer>();
		}
	}
}

[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;
	
    #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();
    #endregion
	
	public Customer()
	{
		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();
			}
		}
	}
	
	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
