#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>
//------------------------------------------------------------------------------

namespace PagingIPagedCollectionView.Web.Models
{
	using System.Data.Linq;
	using System.Data.Linq.Mapping;
	using System.Data;
	using System.Collections.Generic;
	using System.Reflection;
	using System.Linq;
	using System.Linq.Expressions;
	using System.ComponentModel;
	using System;
	
	
	[System.Data.Linq.Mapping.DatabaseAttribute(Name="Chinook")]
	public partial class ChinookModelDataContext : System.Data.Linq.DataContext
	{
		
		private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
		
    #region Extensibility Method Definitions
    partial void OnCreated();
    partial void InsertInvoice(Invoice instance);
    partial void UpdateInvoice(Invoice instance);
    partial void DeleteInvoice(Invoice instance);
    #endregion
		
		public ChinookModelDataContext() : 
				base(global::System.Configuration.ConfigurationManager.ConnectionStrings["ChinookConnectionString"].ConnectionString, mappingSource)
		{
			OnCreated();
		}
		
		public ChinookModelDataContext(string connection) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public ChinookModelDataContext(System.Data.IDbConnection connection) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public ChinookModelDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public ChinookModelDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
			OnCreated();
		}
		
		public System.Data.Linq.Table<Invoice> Invoices
		{
			get
			{
				return this.GetTable<Invoice>();
			}
		}
	}
	
	[Table(Name="dbo.Invoice")]
	public partial class Invoice : INotifyPropertyChanging, INotifyPropertyChanged
	{
		
		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
		
		private int _InvoiceId;
		
		private int _CustomerId;
		
		private System.DateTime _InvoiceDate;
		
		private string _BillingAddress;
		
		private string _BillingCity;
		
		private string _BillingState;
		
		private string _BillingCountry;
		
		private string _BillingPostalCode;
		
		private decimal _Total;
		
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnInvoiceIdChanging(int value);
    partial void OnInvoiceIdChanged();
    partial void OnCustomerIdChanging(int value);
    partial void OnCustomerIdChanged();
    partial void OnInvoiceDateChanging(System.DateTime value);
    partial void OnInvoiceDateChanged();
    partial void OnBillingAddressChanging(string value);
    partial void OnBillingAddressChanged();
    partial void OnBillingCityChanging(string value);
    partial void OnBillingCityChanged();
    partial void OnBillingStateChanging(string value);
    partial void OnBillingStateChanged();
    partial void OnBillingCountryChanging(string value);
    partial void OnBillingCountryChanged();
    partial void OnBillingPostalCodeChanging(string value);
    partial void OnBillingPostalCodeChanged();
    partial void OnTotalChanging(decimal value);
    partial void OnTotalChanged();
    #endregion
		
		public Invoice()
		{
			OnCreated();
		}
		
		[Column(Storage="_InvoiceId", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
		public int InvoiceId
		{
			get
			{
				return this._InvoiceId;
			}
			set
			{
				if ((this._InvoiceId != value))
				{
					this.OnInvoiceIdChanging(value);
					this.SendPropertyChanging();
					this._InvoiceId = value;
					this.SendPropertyChanged("InvoiceId");
					this.OnInvoiceIdChanged();
				}
			}
		}
		
		[Column(Storage="_CustomerId", DbType="Int NOT NULL")]
		public int 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="_InvoiceDate", DbType="DateTime NOT NULL")]
		public System.DateTime InvoiceDate
		{
			get
			{
				return this._InvoiceDate;
			}
			set
			{
				if ((this._InvoiceDate != value))
				{
					this.OnInvoiceDateChanging(value);
					this.SendPropertyChanging();
					this._InvoiceDate = value;
					this.SendPropertyChanged("InvoiceDate");
					this.OnInvoiceDateChanged();
				}
			}
		}
		
		[Column(Storage="_BillingAddress", DbType="NVarChar(70)")]
		public string BillingAddress
		{
			get
			{
				return this._BillingAddress;
			}
			set
			{
				if ((this._BillingAddress != value))
				{
					this.OnBillingAddressChanging(value);
					this.SendPropertyChanging();
					this._BillingAddress = value;
					this.SendPropertyChanged("BillingAddress");
					this.OnBillingAddressChanged();
				}
			}
		}
		
		[Column(Storage="_BillingCity", DbType="NVarChar(40)")]
		public string BillingCity
		{
			get
			{
				return this._BillingCity;
			}
			set
			{
				if ((this._BillingCity != value))
				{
					this.OnBillingCityChanging(value);
					this.SendPropertyChanging();
					this._BillingCity = value;
					this.SendPropertyChanged("BillingCity");
					this.OnBillingCityChanged();
				}
			}
		}
		
		[Column(Storage="_BillingState", DbType="NVarChar(40)")]
		public string BillingState
		{
			get
			{
				return this._BillingState;
			}
			set
			{
				if ((this._BillingState != value))
				{
					this.OnBillingStateChanging(value);
					this.SendPropertyChanging();
					this._BillingState = value;
					this.SendPropertyChanged("BillingState");
					this.OnBillingStateChanged();
				}
			}
		}
		
		[Column(Storage="_BillingCountry", DbType="NVarChar(40)")]
		public string BillingCountry
		{
			get
			{
				return this._BillingCountry;
			}
			set
			{
				if ((this._BillingCountry != value))
				{
					this.OnBillingCountryChanging(value);
					this.SendPropertyChanging();
					this._BillingCountry = value;
					this.SendPropertyChanged("BillingCountry");
					this.OnBillingCountryChanged();
				}
			}
		}
		
		[Column(Storage="_BillingPostalCode", DbType="NVarChar(10)")]
		public string BillingPostalCode
		{
			get
			{
				return this._BillingPostalCode;
			}
			set
			{
				if ((this._BillingPostalCode != value))
				{
					this.OnBillingPostalCodeChanging(value);
					this.SendPropertyChanging();
					this._BillingPostalCode = value;
					this.SendPropertyChanged("BillingPostalCode");
					this.OnBillingPostalCodeChanged();
				}
			}
		}
		
		[Column(Storage="_Total", DbType="Decimal(10,2) NOT NULL")]
		public decimal Total
		{
			get
			{
				return this._Total;
			}
			set
			{
				if ((this._Total != value))
				{
					this.OnTotalChanging(value);
					this.SendPropertyChanging();
					this._Total = value;
					this.SendPropertyChanged("Total");
					this.OnTotalChanged();
				}
			}
		}
		
		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
