#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.1
//
//     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;
using System.Runtime.Serialization;



[global::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 InsertSupplier(Supplier instance);
  partial void UpdateSupplier(Supplier instance);
  partial void DeleteSupplier(Supplier 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<Supplier> Suppliers
	{
		get
		{
			return this.GetTable<Supplier>();
		}
	}
}

[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Suppliers")]
[global::System.Runtime.Serialization.DataContractAttribute()]
public partial class Supplier : INotifyPropertyChanging, INotifyPropertyChanged
{
	
	private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
	
	private int _SupplierID;
	
	private string _CompanyName;
	
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnSupplierIDChanging(int value);
    partial void OnSupplierIDChanged();
    partial void OnCompanyNameChanging(string value);
    partial void OnCompanyNameChanged();
    #endregion
	
	public Supplier()
	{
		this.Initialize();
	}
	
	[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SupplierID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
	[global::System.Runtime.Serialization.DataMemberAttribute(Order=1)]
	public int SupplierID
	{
		get
		{
			return this._SupplierID;
		}
		set
		{
			if ((this._SupplierID != value))
			{
				this.OnSupplierIDChanging(value);
				this.SendPropertyChanging();
				this._SupplierID = value;
				this.SendPropertyChanged("SupplierID");
				this.OnSupplierIDChanged();
			}
		}
	}
	
	[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompanyName", DbType="NVarChar(40) NOT NULL", CanBeNull=false)]
	[global::System.Runtime.Serialization.DataMemberAttribute(Order=2)]
	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();
			}
		}
	}
	
	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 Initialize()
	{
		OnCreated();
	}
	
	[global::System.Runtime.Serialization.OnDeserializingAttribute()]
	[global::System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
	public void OnDeserializing(StreamingContext context)
	{
		this.Initialize();
	}
}
#pragma warning restore 1591
