[System.Data.Linq.Mapping.DatabaseAttribute(Name="Northwind")]
public partial class nwDataContext : System.Data.Linq.DataContext {

// ...

public System.Data.Linq.Table<Order> Orders {
	get { return this.GetTable<Order>(); }
}
}
 [Table(Name="dbo.Orders")]
public partial class Order : INotifyPropertyChanging, INotifyPropertyChanged {
private int _OrderID;
private string _CustomerID;
private System.Nullable<System.DateTime> _OrderDate;

[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 ForeignKeyReferenceAlreadyHasValueException();
}
this.OnCustomerIDChanging(value);
this.SendPropertyChanging();
this._CustomerID = value;
this.SendPropertyChanged("CustomerID");
this.OnCustomerIDChanged();
}
}
}

[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();
}
}
}

[Association(Name="Customer_Order", Storage="_Customer",
						ThisKey="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");
}
}
}

// ...
}
