#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>
//------------------------------------------------------------------------------
namespace WCFServer
{
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.Runtime.Serialization;
using System.ComponentModel;
using System;
[System.Data.Linq.Mapping.DatabaseAttribute(Name="AdventureWorks")]
public partial class AdventureWorksDataContext : System.Data.Linq.DataContext
{
private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
#region Extensibility Method Definitions
partial void OnCreated();
partial void InsertProduct(Product instance);
partial void UpdateProduct(Product instance);
partial void DeleteProduct(Product instance);
partial void InsertProductSubcategory(ProductSubcategory instance);
partial void UpdateProductSubcategory(ProductSubcategory instance);
partial void DeleteProductSubcategory(ProductSubcategory instance);
partial void InsertSpecialOfferProduct(SpecialOfferProduct instance);
partial void UpdateSpecialOfferProduct(SpecialOfferProduct instance);
partial void DeleteSpecialOfferProduct(SpecialOfferProduct instance);
partial void InsertProductModel(ProductModel instance);
partial void UpdateProductModel(ProductModel instance);
partial void DeleteProductModel(ProductModel instance);
partial void InsertShoppingCartItem(ShoppingCartItem instance);
partial void UpdateShoppingCartItem(ShoppingCartItem instance);
partial void DeleteShoppingCartItem(ShoppingCartItem instance);
#endregion
public AdventureWorksDataContext() :
base(global::WCFServer.Properties.Settings.Default.AdventureWorksConnectionString, mappingSource)
{
OnCreated();
}
public AdventureWorksDataContext(string connection) :
base(connection, mappingSource)
{
OnCreated();
}
public AdventureWorksDataContext(System.Data.IDbConnection connection) :
base(connection, mappingSource)
{
OnCreated();
}
public AdventureWorksDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}
public AdventureWorksDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}
public System.Data.Linq.Table<Product> Products
{
get
{
return this.GetTable<Product>();
}
}
public System.Data.Linq.Table<ProductSubcategory> ProductSubcategories
{
get
{
return this.GetTable<ProductSubcategory>();
}
}
public System.Data.Linq.Table<SpecialOfferProduct> SpecialOfferProducts
{
get
{
return this.GetTable<SpecialOfferProduct>();
}
}
public System.Data.Linq.Table<ProductModel> ProductModels
{
get
{
return this.GetTable<ProductModel>();
}
}
public System.Data.Linq.Table<ShoppingCartItem> ShoppingCartItems
{
get
{
return this.GetTable<ShoppingCartItem>();
}
}
}
[Table(Name="Production.Product")]
[DataContract()]
public partial class Product : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private int _ProductID;
private string _Name;
private string _ProductNumber;
private bool _MakeFlag;
private bool _FinishedGoodsFlag;
private string _Color;
private short _SafetyStockLevel;
private short _ReorderPoint;
private decimal _StandardCost;
private decimal _ListPrice;
private string _Size;
private string _SizeUnitMeasureCode;
private string _WeightUnitMeasureCode;
private System.Nullable<decimal> _Weight;
private int _DaysToManufacture;
private string _ProductLine;
private string _Class;
private string _Style;
private System.Nullable<int> _ProductSubcategoryID;
private System.Nullable<int> _ProductModelID;
private System.DateTime _SellStartDate;
private System.Nullable<System.DateTime> _SellEndDate;
private System.Nullable<System.DateTime> _DiscontinuedDate;
private System.Guid _rowguid;
private System.DateTime _ModifiedDate;
private EntitySet<SpecialOfferProduct> _SpecialOfferProducts;
private EntitySet<ShoppingCartItem> _ShoppingCartItems;
private EntityRef<ProductSubcategory> _ProductSubcategory;
private EntityRef<ProductModel> _ProductModel;
private bool serializing;
#region Extensibility Method Definitions
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnProductIDChanging(int value);
partial void OnProductIDChanged();
partial void OnNameChanging(string value);
partial void OnNameChanged();
partial void OnProductNumberChanging(string value);
partial void OnProductNumberChanged();
partial void OnMakeFlagChanging(bool value);
partial void OnMakeFlagChanged();
partial void OnFinishedGoodsFlagChanging(bool value);
partial void OnFinishedGoodsFlagChanged();
partial void OnColorChanging(string value);
partial void OnColorChanged();
partial void OnSafetyStockLevelChanging(short value);
partial void OnSafetyStockLevelChanged();
partial void OnReorderPointChanging(short value);
partial void OnReorderPointChanged();
partial void OnStandardCostChanging(decimal value);
partial void OnStandardCostChanged();
partial void OnListPriceChanging(decimal value);
partial void OnListPriceChanged();
partial void OnSizeChanging(string value);
partial void OnSizeChanged();
partial void OnSizeUnitMeasureCodeChanging(string value);
partial void OnSizeUnitMeasureCodeChanged();
partial void OnWeightUnitMeasureCodeChanging(string value);
partial void OnWeightUnitMeasureCodeChanged();
partial void OnWeightChanging(System.Nullable<decimal> value);
partial void OnWeightChanged();
partial void OnDaysToManufactureChanging(int value);
partial void OnDaysToManufactureChanged();
partial void OnProductLineChanging(string value);
partial void OnProductLineChanged();
partial void OnClassChanging(string value);
partial void OnClassChanged();
partial void OnStyleChanging(string value);
partial void OnStyleChanged();
partial void OnProductSubcategoryIDChanging(System.Nullable<int> value);
partial void OnProductSubcategoryIDChanged();
partial void OnProductModelIDChanging(System.Nullable<int> value);
partial void OnProductModelIDChanged();
partial void OnSellStartDateChanging(System.DateTime value);
partial void OnSellStartDateChanged();
partial void OnSellEndDateChanging(System.Nullable<System.DateTime> value);
partial void OnSellEndDateChanged();
partial void OnDiscontinuedDateChanging(System.Nullable<System.DateTime> value);
partial void OnDiscontinuedDateChanged();
partial void OnrowguidChanging(System.Guid value);
partial void OnrowguidChanged();
partial void OnModifiedDateChanging(System.DateTime value);
partial void OnModifiedDateChanged();
#endregion
public Product()
{
this.Initialize();
}
[Column(Storage="_ProductID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
[DataMember(Order=1)]
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="_Name", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
[DataMember(Order=2)]
public string Name
{
get
{
return this._Name;
}
set
{
if ((this._Name != value))
{
this.OnNameChanging(value);
this.SendPropertyChanging();
this._Name = value;
this.SendPropertyChanged("Name");
this.OnNameChanged();
}
}
}
[Column(Storage="_ProductNumber", DbType="NVarChar(25) NOT NULL", CanBeNull=false)]
[DataMember(Order=3)]
public string ProductNumber
{
get
{
return this._ProductNumber;
}
set
{
if ((this._ProductNumber != value))
{
this.OnProductNumberChanging(value);
this.SendPropertyChanging();
this._ProductNumber = value;
this.SendPropertyChanged("ProductNumber");
this.OnProductNumberChanged();
}
}
}
[Column(Storage="_MakeFlag", DbType="Bit NOT NULL")]
[DataMember(Order=4)]
public bool MakeFlag
{
get
{
return this._MakeFlag;
}
set
{
if ((this._MakeFlag != value))
{
this.OnMakeFlagChanging(value);
this.SendPropertyChanging();
this._MakeFlag = value;
this.SendPropertyChanged("MakeFlag");
this.OnMakeFlagChanged();
}
}
}
[Column(Storage="_FinishedGoodsFlag", DbType="Bit NOT NULL")]
[DataMember(Order=5)]
public bool FinishedGoodsFlag
{
get
{
return this._FinishedGoodsFlag;
}
set
{
if ((this._FinishedGoodsFlag != value))
{
this.OnFinishedGoodsFlagChanging(value);
this.SendPropertyChanging();
this._FinishedGoodsFlag = value;
this.SendPropertyChanged("FinishedGoodsFlag");
this.OnFinishedGoodsFlagChanged();
}
}
}
[Column(Storage="_Color", DbType="NVarChar(15)")]
[DataMember(Order=6)]
public string Color
{
get
{
return this._Color;
}
set
{
if ((this._Color != value))
{
this.OnColorChanging(value);
this.SendPropertyChanging();
this._Color = value;
this.SendPropertyChanged("Color");
this.OnColorChanged();
}
}
}
[Column(Storage="_SafetyStockLevel", DbType="SmallInt NOT NULL")]
[DataMember(Order=7)]
public short SafetyStockLevel
{
get
{
return this._SafetyStockLevel;
}
set
{
if ((this._SafetyStockLevel != value))
{
this.OnSafetyStockLevelChanging(value);
this.SendPropertyChanging();
this._SafetyStockLevel = value;
this.SendPropertyChanged("SafetyStockLevel");
this.OnSafetyStockLevelChanged();
}
}
}
[Column(Storage="_ReorderPoint", DbType="SmallInt NOT NULL")]
[DataMember(Order=8)]
public short ReorderPoint
{
get
{
return this._ReorderPoint;
}
set
{
if ((this._ReorderPoint != value))
{
this.OnReorderPointChanging(value);
this.SendPropertyChanging();
this._ReorderPoint = value;
this.SendPropertyChanged("ReorderPoint");
this.OnReorderPointChanged();
}
}
}
[Column(Storage="_StandardCost", DbType="Money NOT NULL")]
[DataMember(Order=9)]
public decimal StandardCost
{
get
{
return this._StandardCost;
}
set
{
if ((this._StandardCost != value))
{
this.OnStandardCostChanging(value);
this.SendPropertyChanging();
this._StandardCost = value;
this.SendPropertyChanged("StandardCost");
this.OnStandardCostChanged();
}
}
}
[Column(Storage="_ListPrice", DbType="Money NOT NULL")]
[DataMember(Order=10)]
public decimal ListPrice
{
get
{
return this._ListPrice;
}
set
{
if ((this._ListPrice != value))
{
this.OnListPriceChanging(value);
this.SendPropertyChanging();
this._ListPrice = value;
this.SendPropertyChanged("ListPrice");
this.OnListPriceChanged();
}
}
}
[Column(Storage="_Size", DbType="NVarChar(5)")]
[DataMember(Order=11)]
public string Size
{
get
{
return this._Size;
}
set
{
if ((this._Size != value))
{
this.OnSizeChanging(value);
this.SendPropertyChanging();
this._Size = value;
this.SendPropertyChanged("Size");
this.OnSizeChanged();
}
}
}
[Column(Storage="_SizeUnitMeasureCode", DbType="NChar(3)")]
[DataMember(Order=12)]
public string SizeUnitMeasureCode
{
get
{
return this._SizeUnitMeasureCode;
}
set
{
if ((this._SizeUnitMeasureCode != value))
{
this.OnSizeUnitMeasureCodeChanging(value);
this.SendPropertyChanging();
this._SizeUnitMeasureCode = value;
this.SendPropertyChanged("SizeUnitMeasureCode");
this.OnSizeUnitMeasureCodeChanged();
}
}
}
[Column(Storage="_WeightUnitMeasureCode", DbType="NChar(3)")]
[DataMember(Order=13)]
public string WeightUnitMeasureCode
{
get
{
return this._WeightUnitMeasureCode;
}
set
{
if ((this._WeightUnitMeasureCode != value))
{
this.OnWeightUnitMeasureCodeChanging(value);
this.SendPropertyChanging();
this._WeightUnitMeasureCode = value;
this.SendPropertyChanged("WeightUnitMeasureCode");
this.OnWeightUnitMeasureCodeChanged();
}
}
}
[Column(Storage="_Weight", DbType="Decimal(8,2)")]
[DataMember(Order=14)]
public System.Nullable<decimal> Weight
{
get
{
return this._Weight;
}
set
{
if ((this._Weight != value))
{
this.OnWeightChanging(value);
this.SendPropertyChanging();
this._Weight = value;
this.SendPropertyChanged("Weight");
this.OnWeightChanged();
}
}
}
[Column(Storage="_DaysToManufacture", DbType="Int NOT NULL")]
[DataMember(Order=15)]
public int DaysToManufacture
{
get
{
return this._DaysToManufacture;
}
set
{
if ((this._DaysToManufacture != value))
{
this.OnDaysToManufactureChanging(value);
this.SendPropertyChanging();
this._DaysToManufacture = value;
this.SendPropertyChanged("DaysToManufacture");
this.OnDaysToManufactureChanged();
}
}
}
[Column(Storage="_ProductLine", DbType="NChar(2)")]
[DataMember(Order=16)]
public string ProductLine
{
get
{
return this._ProductLine;
}
set
{
if ((this._ProductLine != value))
{
this.OnProductLineChanging(value);
this.SendPropertyChanging();
this._ProductLine = value;
this.SendPropertyChanged("ProductLine");
this.OnProductLineChanged();
}
}
}
[Column(Storage="_Class", DbType="NChar(2)")]
[DataMember(Order=17)]
public string Class
{
get
{
return this._Class;
}
set
{
if ((this._Class != value))
{
this.OnClassChanging(value);
this.SendPropertyChanging();
this._Class = value;
this.SendPropertyChanged("Class");
this.OnClassChanged();
}
}
}
[Column(Storage="_Style", DbType="NChar(2)")]
[DataMember(Order=18)]
public string Style
{
get
{
return this._Style;
}
set
{
if ((this._Style != value))
{
this.OnStyleChanging(value);
this.SendPropertyChanging();
this._Style = value;
this.SendPropertyChanged("Style");
this.OnStyleChanged();
}
}
}
[Column(Storage="_ProductSubcategoryID", DbType="Int")]
[DataMember(Order=19)]
public System.Nullable<int> ProductSubcategoryID
{
get
{
return this._ProductSubcategoryID;
}
set
{
if ((this._ProductSubcategoryID != value))
{
if (this._ProductSubcategory.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnProductSubcategoryIDChanging(value);
this.SendPropertyChanging();
this._ProductSubcategoryID = value;
this.SendPropertyChanged("ProductSubcategoryID");
this.OnProductSubcategoryIDChanged();
}
}
}
[Column(Storage="_ProductModelID", DbType="Int")]
[DataMember(Order=20)]
public System.Nullable<int> ProductModelID
{
get
{
return this._ProductModelID;
}
set
{
if ((this._ProductModelID != value))
{
if (this._ProductModel.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnProductModelIDChanging(value);
this.SendPropertyChanging();
this._ProductModelID = value;
this.SendPropertyChanged("ProductModelID");
this.OnProductModelIDChanged();
}
}
}
[Column(Storage="_SellStartDate", DbType="DateTime NOT NULL")]
[DataMember(Order=21)]
public System.DateTime SellStartDate
{
get
{
return this._SellStartDate;
}
set
{
if ((this._SellStartDate != value))
{
this.OnSellStartDateChanging(value);
this.SendPropertyChanging();
this._SellStartDate = value;
this.SendPropertyChanged("SellStartDate");
this.OnSellStartDateChanged();
}
}
}
[Column(Storage="_SellEndDate", DbType="DateTime")]
[DataMember(Order=22)]
public System.Nullable<System.DateTime> SellEndDate
{
get
{
return this._SellEndDate;
}
set
{
if ((this._SellEndDate != value))
{
this.OnSellEndDateChanging(value);
this.SendPropertyChanging();
this._SellEndDate = value;
this.SendPropertyChanged("SellEndDate");
this.OnSellEndDateChanged();
}
}
}
[Column(Storage="_DiscontinuedDate", DbType="DateTime")]
[DataMember(Order=23)]
public System.Nullable<System.DateTime> DiscontinuedDate
{
get
{
return this._DiscontinuedDate;
}
set
{
if ((this._DiscontinuedDate != value))
{
this.OnDiscontinuedDateChanging(value);
this.SendPropertyChanging();
this._DiscontinuedDate = value;
this.SendPropertyChanged("DiscontinuedDate");
this.OnDiscontinuedDateChanged();
}
}
}
[Column(Storage="_rowguid", DbType="UniqueIdentifier NOT NULL")]
[DataMember(Order=24)]
public System.Guid rowguid
{
get
{
return this._rowguid;
}
set
{
if ((this._rowguid != value))
{
this.OnrowguidChanging(value);
this.SendPropertyChanging();
this._rowguid = value;
this.SendPropertyChanged("rowguid");
this.OnrowguidChanged();
}
}
}
[Column(Storage="_ModifiedDate", DbType="DateTime NOT NULL")]
[DataMember(Order=25)]
public System.DateTime ModifiedDate
{
get
{
return this._ModifiedDate;
}
set
{
if ((this._ModifiedDate != value))
{
this.OnModifiedDateChanging(value);
this.SendPropertyChanging();
this._ModifiedDate = value;
this.SendPropertyChanged("ModifiedDate");
this.OnModifiedDateChanged();
}
}
}
[Association(Name="Product_SpecialOfferProduct", Storage="_SpecialOfferProducts", ThisKey="ProductID", OtherKey="ProductID")]
[DataMember(Order=26, EmitDefaultValue=false)]
public EntitySet<SpecialOfferProduct> SpecialOfferProducts
{
get
{
if ((this.serializing
&& (this._SpecialOfferProducts.HasLoadedOrAssignedValues == false)))
{
return null;
}
return this._SpecialOfferProducts;
}
set
{
this._SpecialOfferProducts.Assign(value);
}
}
[Association(Name="Product_ShoppingCartItem", Storage="_ShoppingCartItems", ThisKey="ProductID", OtherKey="ProductID")]
[DataMember(Order=27, EmitDefaultValue=false)]
public EntitySet<ShoppingCartItem> ShoppingCartItems
{
get
{
if ((this.serializing
&& (this._ShoppingCartItems.HasLoadedOrAssignedValues == false)))
{
return null;
}
return this._ShoppingCartItems;
}
set
{
this._ShoppingCartItems.Assign(value);
}
}
[Association(Name="ProductSubcategory_Product", Storage="_ProductSubcategory", ThisKey="ProductSubcategoryID", OtherKey="ProductSubcategoryID", IsForeignKey=true)]
public ProductSubcategory ProductSubcategory
{
get
{
return this._ProductSubcategory.Entity;
}
set
{
ProductSubcategory previousValue = this._ProductSubcategory.Entity;
if (((previousValue != value)
|| (this._ProductSubcategory.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
if ((previousValue != null))
{
this._ProductSubcategory.Entity = null;
previousValue.Products.Remove(this);
}
this._ProductSubcategory.Entity = value;
if ((value != null))
{
value.Products.Add(this);
this._ProductSubcategoryID = value.ProductSubcategoryID;
}
else
{
this._ProductSubcategoryID = default(Nullable<int>);
}
this.SendPropertyChanged("ProductSubcategory");
}
}
}
[Association(Name="ProductModel_Product", Storage="_ProductModel", ThisKey="ProductModelID", OtherKey="ProductModelID", IsForeignKey=true)]
public ProductModel ProductModel
{
get
{
return this._ProductModel.Entity;
}
set
{
ProductModel previousValue = this._ProductModel.Entity;
if (((previousValue != value)
|| (this._ProductModel.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
if ((previousValue != null))
{
this._ProductModel.Entity = null;
previousValue.Products.Remove(this);
}
this._ProductModel.Entity = value;
if ((value != null))
{
value.Products.Add(this);
this._ProductModelID = value.ProductModelID;
}
else
{
this._ProductModelID = default(Nullable<int>);
}
this.SendPropertyChanged("ProductModel");
}
}
}
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_SpecialOfferProducts(SpecialOfferProduct entity)
{
this.SendPropertyChanging();
entity.Product = this;
}
private void detach_SpecialOfferProducts(SpecialOfferProduct entity)
{
this.SendPropertyChanging();
entity.Product = null;
}
private void attach_ShoppingCartItems(ShoppingCartItem entity)
{
this.SendPropertyChanging();
entity.Product = this;
}
private void detach_ShoppingCartItems(ShoppingCartItem entity)
{
this.SendPropertyChanging();
entity.Product = null;
}
private void Initialize()
{
this._SpecialOfferProducts = new EntitySet<SpecialOfferProduct>(new Action<SpecialOfferProduct>(this.attach_SpecialOfferProducts), new Action<SpecialOfferProduct>(this.detach_SpecialOfferProducts));
this._ShoppingCartItems = new EntitySet<ShoppingCartItem>(new Action<ShoppingCartItem>(this.attach_ShoppingCartItems), new Action<ShoppingCartItem>(this.detach_ShoppingCartItems));
this._ProductSubcategory = default(EntityRef<ProductSubcategory>);
this._ProductModel = default(EntityRef<ProductModel>);
OnCreated();
}
[OnDeserializing()]
[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
public void OnDeserializing(StreamingContext context)
{
this.Initialize();
}
[OnSerializing()]
[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
public void OnSerializing(StreamingContext context)
{
this.serializing = true;
}
[OnSerialized()]
[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
public void OnSerialized(StreamingContext context)
{
this.serializing = false;
}
}
[Table(Name="Production.ProductSubcategory")]
[DataContract()]
public partial class ProductSubcategory : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private int _ProductSubcategoryID;
private int _ProductCategoryID;
private string _Name;
private System.Guid _rowguid;
private System.DateTime _ModifiedDate;
private EntitySet<Product> _Products;
private bool serializing;
#region Extensibility Method Definitions
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnProductSubcategoryIDChanging(int value);
partial void OnProductSubcategoryIDChanged();
partial void OnProductCategoryIDChanging(int value);
partial void OnProductCategoryIDChanged();
partial void OnNameChanging(string value);
partial void OnNameChanged();
partial void OnrowguidChanging(System.Guid value);
partial void OnrowguidChanged();
partial void OnModifiedDateChanging(System.DateTime value);
partial void OnModifiedDateChanged();
#endregion
public ProductSubcategory()
{
this.Initialize();
}
[Column(Storage="_ProductSubcategoryID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
[DataMember(Order=1)]
public int ProductSubcategoryID
{
get
{
return this._ProductSubcategoryID;
}
set
{
if ((this._ProductSubcategoryID != value))
{
this.OnProductSubcategoryIDChanging(value);
this.SendPropertyChanging();
this._ProductSubcategoryID = value;
this.SendPropertyChanged("ProductSubcategoryID");
this.OnProductSubcategoryIDChanged();
}
}
}
[Column(Storage="_ProductCategoryID", DbType="Int NOT NULL")]
[DataMember(Order=2)]
public int ProductCategoryID
{
get
{
return this._ProductCategoryID;
}
set
{
if ((this._ProductCategoryID != value))
{
this.OnProductCategoryIDChanging(value);
this.SendPropertyChanging();
this._ProductCategoryID = value;
this.SendPropertyChanged("ProductCategoryID");
this.OnProductCategoryIDChanged();
}
}
}
[Column(Storage="_Name", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
[DataMember(Order=3)]
public string Name
{
get
{
return this._Name;
}
set
{
if ((this._Name != value))
{
this.OnNameChanging(value);
this.SendPropertyChanging();
this._Name = value;
this.SendPropertyChanged("Name");
this.OnNameChanged();
}
}
}
[Column(Storage="_rowguid", DbType="UniqueIdentifier NOT NULL")]
[DataMember(Order=4)]
public System.Guid rowguid
{
get
{
return this._rowguid;
}
set
{
if ((this._rowguid != value))
{
this.OnrowguidChanging(value);
this.SendPropertyChanging();
this._rowguid = value;
this.SendPropertyChanged("rowguid");
this.OnrowguidChanged();
}
}
}
[Column(Storage="_ModifiedDate", DbType="DateTime NOT NULL")]
[DataMember(Order=5)]
public System.DateTime ModifiedDate
{
get
{
return this._ModifiedDate;
}
set
{
if ((this._ModifiedDate != value))
{
this.OnModifiedDateChanging(value);
this.SendPropertyChanging();
this._ModifiedDate = value;
this.SendPropertyChanged("ModifiedDate");
this.OnModifiedDateChanged();
}
}
}
[Association(Name="ProductSubcategory_Product", Storage="_Products", ThisKey="ProductSubcategoryID", OtherKey="ProductSubcategoryID")]
[DataMember(Order=6, EmitDefaultValue=false)]
public EntitySet<Product> Products
{
get
{
if ((this.serializing
&& (this._Products.HasLoadedOrAssignedValues == false)))
{
return null;
}
return this._Products;
}
set
{
this._Products.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_Products(Product entity)
{
this.SendPropertyChanging();
entity.ProductSubcategory = this;
}
private void detach_Products(Product entity)
{
this.SendPropertyChanging();
entity.ProductSubcategory = null;
}
private void Initialize()
{
this._Products = new EntitySet<Product>(new Action<Product>(this.attach_Products), new Action<Product>(this.detach_Products));
OnCreated();
}
[OnDeserializing()]
[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
public void OnDeserializing(StreamingContext context)
{
this.Initialize();
}
[OnSerializing()]
[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
public void OnSerializing(StreamingContext context)
{
this.serializing = true;
}
[OnSerialized()]
[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
public void OnSerialized(StreamingContext context)
{
this.serializing = false;
}
}
[Table(Name="Sales.SpecialOfferProduct")]
[DataContract()]
public partial class SpecialOfferProduct : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private int _SpecialOfferID;
private int _ProductID;
private System.Guid _rowguid;
private System.DateTime _ModifiedDate;
private EntityRef<Product> _Product;
#region Extensibility Method Definitions
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnSpecialOfferIDChanging(int value);
partial void OnSpecialOfferIDChanged();
partial void OnProductIDChanging(int value);
partial void OnProductIDChanged();
partial void OnrowguidChanging(System.Guid value);
partial void OnrowguidChanged();
partial void OnModifiedDateChanging(System.DateTime value);
partial void OnModifiedDateChanged();
#endregion
public SpecialOfferProduct()
{
this.Initialize();
}
[Column(Storage="_SpecialOfferID", DbType="Int NOT NULL", IsPrimaryKey=true)]
[DataMember(Order=1)]
public int SpecialOfferID
{
get
{
return this._SpecialOfferID;
}
set
{
if ((this._SpecialOfferID != value))
{
this.OnSpecialOfferIDChanging(value);
this.SendPropertyChanging();
this._SpecialOfferID = value;
this.SendPropertyChanged("SpecialOfferID");
this.OnSpecialOfferIDChanged();
}
}
}
[Column(Storage="_ProductID", DbType="Int NOT NULL", IsPrimaryKey=true)]
[DataMember(Order=2)]
public int ProductID
{
get
{
return this._ProductID;
}
set
{
if ((this._ProductID != value))
{
if (this._Product.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnProductIDChanging(value);
this.SendPropertyChanging();
this._ProductID = value;
this.SendPropertyChanged("ProductID");
this.OnProductIDChanged();
}
}
}
[Column(Storage="_rowguid", DbType="UniqueIdentifier NOT NULL")]
[DataMember(Order=3)]
public System.Guid rowguid
{
get
{
return this._rowguid;
}
set
{
if ((this._rowguid != value))
{
this.OnrowguidChanging(value);
this.SendPropertyChanging();
this._rowguid = value;
this.SendPropertyChanged("rowguid");
this.OnrowguidChanged();
}
}
}
[Column(Storage="_ModifiedDate", DbType="DateTime NOT NULL")]
[DataMember(Order=4)]
public System.DateTime ModifiedDate
{
get
{
return this._ModifiedDate;
}
set
{
if ((this._ModifiedDate != value))
{
this.OnModifiedDateChanging(value);
this.SendPropertyChanging();
this._ModifiedDate = value;
this.SendPropertyChanged("ModifiedDate");
this.OnModifiedDateChanged();
}
}
}
[Association(Name="Product_SpecialOfferProduct", Storage="_Product", ThisKey="ProductID", OtherKey="ProductID", IsForeignKey=true)]
public Product Product
{
get
{
return this._Product.Entity;
}
set
{
Product previousValue = this._Product.Entity;
if (((previousValue != value)
|| (this._Product.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
if ((previousValue != null))
{
this._Product.Entity = null;
previousValue.SpecialOfferProducts.Remove(this);
}
this._Product.Entity = value;
if ((value != null))
{
value.SpecialOfferProducts.Add(this);
this._ProductID = value.ProductID;
}
else
{
this._ProductID = default(int);
}
this.SendPropertyChanged("Product");
}
}
}
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()
{
this._Product = default(EntityRef<Product>);
OnCreated();
}
[OnDeserializing()]
[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
public void OnDeserializing(StreamingContext context)
{
this.Initialize();
}
}
[Table(Name="Production.ProductModel")]
[DataContract()]
public partial class ProductModel : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private int _ProductModelID;
private string _Name;
private System.Xml.Linq.XElement _CatalogDescription;
private System.Xml.Linq.XElement _Instructions;
private System.Guid _rowguid;
private System.DateTime _ModifiedDate;
private EntitySet<Product> _Products;
private bool serializing;
#region Extensibility Method Definitions
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnProductModelIDChanging(int value);
partial void OnProductModelIDChanged();
partial void OnNameChanging(string value);
partial void OnNameChanged();
partial void OnCatalogDescriptionChanging(System.Xml.Linq.XElement value);
partial void OnCatalogDescriptionChanged();
partial void OnInstructionsChanging(System.Xml.Linq.XElement value);
partial void OnInstructionsChanged();
partial void OnrowguidChanging(System.Guid value);
partial void OnrowguidChanged();
partial void OnModifiedDateChanging(System.DateTime value);
partial void OnModifiedDateChanged();
#endregion
public ProductModel()
{
this.Initialize();
}
[Column(Storage="_ProductModelID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
[DataMember(Order=1)]
public int ProductModelID
{
get
{
return this._ProductModelID;
}
set
{
if ((this._ProductModelID != value))
{
this.OnProductModelIDChanging(value);
this.SendPropertyChanging();
this._ProductModelID = value;
this.SendPropertyChanged("ProductModelID");
this.OnProductModelIDChanged();
}
}
}
[Column(Storage="_Name", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
[DataMember(Order=2)]
public string Name
{
get
{
return this._Name;
}
set
{
if ((this._Name != value))
{
this.OnNameChanging(value);
this.SendPropertyChanging();
this._Name = value;
this.SendPropertyChanged("Name");
this.OnNameChanged();
}
}
}
[Column(Storage="_CatalogDescription", DbType="Xml", UpdateCheck=UpdateCheck.Never)]
[DataMember(Order=3)]
public System.Xml.Linq.XElement CatalogDescription
{
get
{
return this._CatalogDescription;
}
set
{
if ((this._CatalogDescription != value))
{
this.OnCatalogDescriptionChanging(value);
this.SendPropertyChanging();
this._CatalogDescription = value;
this.SendPropertyChanged("CatalogDescription");
this.OnCatalogDescriptionChanged();
}
}
}
[Column(Storage="_Instructions", DbType="Xml", UpdateCheck=UpdateCheck.Never)]
[DataMember(Order=4)]
public System.Xml.Linq.XElement Instructions
{
get
{
return this._Instructions;
}
set
{
if ((this._Instructions != value))
{
this.OnInstructionsChanging(value);
this.SendPropertyChanging();
this._Instructions = value;
this.SendPropertyChanged("Instructions");
this.OnInstructionsChanged();
}
}
}
[Column(Storage="_rowguid", DbType="UniqueIdentifier NOT NULL")]
[DataMember(Order=5)]
public System.Guid rowguid
{
get
{
return this._rowguid;
}
set
{
if ((this._rowguid != value))
{
this.OnrowguidChanging(value);
this.SendPropertyChanging();
this._rowguid = value;
this.SendPropertyChanged("rowguid");
this.OnrowguidChanged();
}
}
}
[Column(Storage="_ModifiedDate", DbType="DateTime NOT NULL")]
[DataMember(Order=6)]
public System.DateTime ModifiedDate
{
get
{
return this._ModifiedDate;
}
set
{
if ((this._ModifiedDate != value))
{
this.OnModifiedDateChanging(value);
this.SendPropertyChanging();
this._ModifiedDate = value;
this.SendPropertyChanged("ModifiedDate");
this.OnModifiedDateChanged();
}
}
}
[Association(Name="ProductModel_Product", Storage="_Products", ThisKey="ProductModelID", OtherKey="ProductModelID")]
[DataMember(Order=7, EmitDefaultValue=false)]
public EntitySet<Product> Products
{
get
{
if ((this.serializing
&& (this._Products.HasLoadedOrAssignedValues == false)))
{
return null;
}
return this._Products;
}
set
{
this._Products.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_Products(Product entity)
{
this.SendPropertyChanging();
entity.ProductModel = this;
}
private void detach_Products(Product entity)
{
this.SendPropertyChanging();
entity.ProductModel = null;
}
private void Initialize()
{
this._Products = new EntitySet<Product>(new Action<Product>(this.attach_Products), new Action<Product>(this.detach_Products));
OnCreated();
}
[OnDeserializing()]
[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
public void OnDeserializing(StreamingContext context)
{
this.Initialize();
}
[OnSerializing()]
[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
public void OnSerializing(StreamingContext context)
{
this.serializing = true;
}
[OnSerialized()]
[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
public void OnSerialized(StreamingContext context)
{
this.serializing = false;
}
}
[Table(Name="Sales.ShoppingCartItem")]
[DataContract()]
public partial class ShoppingCartItem : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private int _ShoppingCartItemID;
private string _ShoppingCartID;
private int _Quantity;
private int _ProductID;
private System.DateTime _DateCreated;
private System.DateTime _ModifiedDate;
private EntityRef<Product> _Product;
#region Extensibility Method Definitions
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnShoppingCartItemIDChanging(int value);
partial void OnShoppingCartItemIDChanged();
partial void OnShoppingCartIDChanging(string value);
partial void OnShoppingCartIDChanged();
partial void OnQuantityChanging(int value);
partial void OnQuantityChanged();
partial void OnProductIDChanging(int value);
partial void OnProductIDChanged();
partial void OnDateCreatedChanging(System.DateTime value);
partial void OnDateCreatedChanged();
partial void OnModifiedDateChanging(System.DateTime value);
partial void OnModifiedDateChanged();
#endregion
public ShoppingCartItem()
{
this.Initialize();
}
[Column(Storage="_ShoppingCartItemID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
[DataMember(Order=1)]
public int ShoppingCartItemID
{
get
{
return this._ShoppingCartItemID;
}
set
{
if ((this._ShoppingCartItemID != value))
{
this.OnShoppingCartItemIDChanging(value);
this.SendPropertyChanging();
this._ShoppingCartItemID = value;
this.SendPropertyChanged("ShoppingCartItemID");
this.OnShoppingCartItemIDChanged();
}
}
}
[Column(Storage="_ShoppingCartID", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
[DataMember(Order=2)]
public string ShoppingCartID
{
get
{
return this._ShoppingCartID;
}
set
{
if ((this._ShoppingCartID != value))
{
this.OnShoppingCartIDChanging(value);
this.SendPropertyChanging();
this._ShoppingCartID = value;
this.SendPropertyChanged("ShoppingCartID");
this.OnShoppingCartIDChanged();
}
}
}
[Column(Storage="_Quantity", DbType="Int NOT NULL")]
[DataMember(Order=3)]
public int 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="_ProductID", DbType="Int NOT NULL")]
[DataMember(Order=4)]
public int ProductID
{
get
{
return this._ProductID;
}
set
{
if ((this._ProductID != value))
{
if (this._Product.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnProductIDChanging(value);
this.SendPropertyChanging();
this._ProductID = value;
this.SendPropertyChanged("ProductID");
this.OnProductIDChanged();
}
}
}
[Column(Storage="_DateCreated", DbType="DateTime NOT NULL")]
[DataMember(Order=5)]
public System.DateTime DateCreated
{
get
{
return this._DateCreated;
}
set
{
if ((this._DateCreated != value))
{
this.OnDateCreatedChanging(value);
this.SendPropertyChanging();
this._DateCreated = value;
this.SendPropertyChanged("DateCreated");
this.OnDateCreatedChanged();
}
}
}
[Column(Storage="_ModifiedDate", DbType="DateTime NOT NULL")]
[DataMember(Order=6)]
public System.DateTime ModifiedDate
{
get
{
return this._ModifiedDate;
}
set
{
if ((this._ModifiedDate != value))
{
this.OnModifiedDateChanging(value);
this.SendPropertyChanging();
this._ModifiedDate = value;
this.SendPropertyChanged("ModifiedDate");
this.OnModifiedDateChanged();
}
}
}
[Association(Name="Product_ShoppingCartItem", Storage="_Product", ThisKey="ProductID", OtherKey="ProductID", IsForeignKey=true)]
public Product Product
{
get
{
return this._Product.Entity;
}
set
{
Product previousValue = this._Product.Entity;
if (((previousValue != value)
|| (this._Product.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
if ((previousValue != null))
{
this._Product.Entity = null;
previousValue.ShoppingCartItems.Remove(this);
}
this._Product.Entity = value;
if ((value != null))
{
value.ShoppingCartItems.Add(this);
this._ProductID = value.ProductID;
}
else
{
this._ProductID = default(int);
}
this.SendPropertyChanged("Product");
}
}
}
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()
{
this._Product = default(EntityRef<Product>);
OnCreated();
}
[OnDeserializing()]
[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
public void OnDeserializing(StreamingContext context)
{
this.Initialize();
}
}
}
#pragma warning restore 1591