//------------------------------------------------------------------------------
// <auto-generated>
//    This code was generated from a template.
//
//    Manual changes to this file may cause unexpected behavior in your application.
//    Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Data.Objects;
using System.Data.Objects.DataClasses;
using System.Data.EntityClient;
using System.ComponentModel;
using System.Xml.Serialization;
using System.Runtime.Serialization;

[assembly: EdmSchemaAttribute()]
#region EDM Relationship Metadata

[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_EmployeeDepartmentHistory_Department_DepartmentID", "Department", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Department), "EmployeeDepartmentHistory", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.EmployeeDepartmentHistory), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_Employee_Contact_ContactID", "Contact", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Contact), "Employee", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.Employee), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_Employee_Employee_ManagerID", "Employee", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(AdventureWorksProcs.Employee), "Employee1", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.Employee), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_EmployeeAddress_Employee_EmployeeID", "Employee", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Employee), "EmployeeAddress", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.EmployeeAddress), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_EmployeeDepartmentHistory_Employee_EmployeeID", "Employee", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Employee), "EmployeeDepartmentHistory", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.EmployeeDepartmentHistory), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_EmployeePayHistory_Employee_EmployeeID", "Employee", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Employee), "EmployeePayHistory", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.EmployeePayHistory), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_JobCandidate_Employee_EmployeeID", "Employee", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(AdventureWorksProcs.Employee), "JobCandidate", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.JobCandidate), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_PurchaseOrderHeader_Employee_EmployeeID", "Employee", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Employee), "PurchaseOrderHeader", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.PurchaseOrderHeader), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_SalesPerson_Employee_SalesPersonID", "Employee", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Employee), "SalesPerson", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(AdventureWorksProcs.SalesPerson), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_EmployeeAddress_Address_AddressID", "Address", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Address), "EmployeeAddress", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.EmployeeAddress), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_EmployeeDepartmentHistory_Shift_ShiftID", "Shift", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Shift), "EmployeeDepartmentHistory", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.EmployeeDepartmentHistory), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_Address_StateProvince_StateProvinceID", "StateProvince", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.StateProvince), "Address", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.Address), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_CustomerAddress_Address_AddressID", "Address", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Address), "CustomerAddress", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.CustomerAddress), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Address_BillToAddressID", "Address", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Address), "SalesOrderHeader", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.SalesOrderHeader), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Address_ShipToAddressID", "Address", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Address), "SalesOrderHeader", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.SalesOrderHeader), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_VendorAddress_Address_AddressID", "Address", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Address), "VendorAddress", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.VendorAddress), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_CustomerAddress_AddressType_AddressTypeID", "AddressType", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.AddressType), "CustomerAddress", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.CustomerAddress), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_VendorAddress_AddressType_AddressTypeID", "AddressType", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.AddressType), "VendorAddress", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.VendorAddress), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_ContactCreditCard_Contact_ContactID", "Contact", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Contact), "ContactCreditCard", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.ContactCreditCard), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_Individual_Contact_ContactID", "Contact", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Contact), "Individual", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.Individual), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Contact_ContactID", "Contact", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Contact), "SalesOrderHeader", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.SalesOrderHeader), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_StoreContact_Contact_ContactID", "Contact", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Contact), "StoreContact", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.StoreContact), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_VendorContact_Contact_ContactID", "Contact", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Contact), "VendorContact", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.VendorContact), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_StoreContact_ContactType_ContactTypeID", "ContactType", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.ContactType), "StoreContact", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.StoreContact), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_VendorContact_ContactType_ContactTypeID", "ContactType", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.ContactType), "VendorContact", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.VendorContact), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_CountryRegionCurrency_CountryRegion_CountryRegionCode", "CountryRegion", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.CountryRegion), "CountryRegionCurrency", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.CountryRegionCurrency), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_StateProvince_CountryRegion_CountryRegionCode", "CountryRegion", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.CountryRegion), "StateProvince", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.StateProvince), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_SalesTaxRate_StateProvince_StateProvinceID", "StateProvince", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.StateProvince), "SalesTaxRate", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.SalesTaxRate), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_StateProvince_SalesTerritory_TerritoryID", "SalesTerritory", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.SalesTerritory), "StateProvince", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.StateProvince), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_BillOfMaterials_Product_ComponentID", "Product", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Product), "BillOfMaterials", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.BillOfMaterial), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_BillOfMaterials_Product_ProductAssemblyID", "Product", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(AdventureWorksProcs.Product), "BillOfMaterials", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.BillOfMaterial), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_BillOfMaterials_UnitMeasure_UnitMeasureCode", "UnitMeasure", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.UnitMeasure), "BillOfMaterials", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.BillOfMaterial), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_ProductModelProductDescriptionCulture_Culture_CultureID", "Culture", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Culture), "ProductModelProductDescriptionCulture", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.ProductModelProductDescriptionCulture), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_ProductDocument_Document_DocumentID", "Document", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Document), "ProductDocument", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.ProductDocument), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_ProductModelIllustration_Illustration_IllustrationID", "Illustration", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Illustration), "ProductModelIllustration", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.ProductModelIllustration), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_ProductInventory_Location_LocationID", "Location", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Location), "ProductInventory", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.ProductInventory), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_WorkOrderRouting_Location_LocationID", "Location", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Location), "WorkOrderRouting", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.WorkOrderRouting), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_Product_ProductModel_ProductModelID", "ProductModel", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(AdventureWorksProcs.ProductModel), "Product", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.Product), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_Product_ProductSubcategory_ProductSubcategoryID", "ProductSubcategory", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(AdventureWorksProcs.ProductSubcategory), "Product", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.Product), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_Product_UnitMeasure_SizeUnitMeasureCode", "UnitMeasure", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(AdventureWorksProcs.UnitMeasure), "Product", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.Product), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_Product_UnitMeasure_WeightUnitMeasureCode", "UnitMeasure", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(AdventureWorksProcs.UnitMeasure), "Product", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.Product), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_ProductCostHistory_Product_ProductID", "Product", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Product), "ProductCostHistory", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.ProductCostHistory), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_ProductDocument_Product_ProductID", "Product", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Product), "ProductDocument", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.ProductDocument), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_ProductInventory_Product_ProductID", "Product", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Product), "ProductInventory", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.ProductInventory), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_ProductListPriceHistory_Product_ProductID", "Product", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Product), "ProductListPriceHistory", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.ProductListPriceHistory), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_ProductProductPhoto_Product_ProductID", "Product", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Product), "ProductProductPhoto", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.ProductProductPhoto), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_ProductReview_Product_ProductID", "Product", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Product), "ProductReview", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.ProductReview), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_ProductVendor_Product_ProductID", "Product", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Product), "ProductVendor", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.ProductVendor), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_PurchaseOrderDetail_Product_ProductID", "Product", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Product), "PurchaseOrderDetail", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.PurchaseOrderDetail), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_ShoppingCartItem_Product_ProductID", "Product", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Product), "ShoppingCartItem", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.ShoppingCartItem), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_SpecialOfferProduct_Product_ProductID", "Product", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Product), "SpecialOfferProduct", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.SpecialOfferProduct), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_TransactionHistory_Product_ProductID", "Product", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Product), "TransactionHistory", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.TransactionHistory), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_WorkOrder_Product_ProductID", "Product", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Product), "WorkOrder", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.WorkOrder), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_ProductSubcategory_ProductCategory_ProductCategoryID", "ProductCategory", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.ProductCategory), "ProductSubcategory", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.ProductSubcategory), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID", "ProductDescription", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.ProductDescription), "ProductModelProductDescriptionCulture", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.ProductModelProductDescriptionCulture), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_ProductModelIllustration_ProductModel_ProductModelID", "ProductModel", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.ProductModel), "ProductModelIllustration", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.ProductModelIllustration), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID", "ProductModel", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.ProductModel), "ProductModelProductDescriptionCulture", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.ProductModelProductDescriptionCulture), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_ProductProductPhoto_ProductPhoto_ProductPhotoID", "ProductPhoto", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.ProductPhoto), "ProductProductPhoto", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.ProductProductPhoto), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_WorkOrder_ScrapReason_ScrapReasonID", "ScrapReason", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(AdventureWorksProcs.ScrapReason), "WorkOrder", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.WorkOrder), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_ProductVendor_UnitMeasure_UnitMeasureCode", "UnitMeasure", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.UnitMeasure), "ProductVendor", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.ProductVendor), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_WorkOrderRouting_WorkOrder_WorkOrderID", "WorkOrder", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.WorkOrder), "WorkOrderRouting", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.WorkOrderRouting), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_ProductVendor_Vendor_VendorID", "Vendor", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Vendor), "ProductVendor", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.ProductVendor), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID", "PurchaseOrderHeader", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.PurchaseOrderHeader), "PurchaseOrderDetail", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.PurchaseOrderDetail), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_PurchaseOrderHeader_ShipMethod_ShipMethodID", "ShipMethod", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.ShipMethod), "PurchaseOrderHeader", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.PurchaseOrderHeader), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_PurchaseOrderHeader_Vendor_VendorID", "Vendor", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Vendor), "PurchaseOrderHeader", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.PurchaseOrderHeader), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_SalesOrderHeader_ShipMethod_ShipMethodID", "ShipMethod", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.ShipMethod), "SalesOrderHeader", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.SalesOrderHeader), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_VendorAddress_Vendor_VendorID", "Vendor", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Vendor), "VendorAddress", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.VendorAddress), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_VendorContact_Vendor_VendorID", "Vendor", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Vendor), "VendorContact", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.VendorContact), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_ContactCreditCard_CreditCard_CreditCardID", "CreditCard", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.CreditCard), "ContactCreditCard", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.ContactCreditCard), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_CountryRegionCurrency_Currency_CurrencyCode", "Currency", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Currency), "CountryRegionCurrency", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.CountryRegionCurrency), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_SalesOrderHeader_CreditCard_CreditCardID", "CreditCard", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(AdventureWorksProcs.CreditCard), "SalesOrderHeader", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.SalesOrderHeader), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_CurrencyRate_Currency_FromCurrencyCode", "Currency", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Currency), "CurrencyRate", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.CurrencyRate), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_CurrencyRate_Currency_ToCurrencyCode", "Currency", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Currency), "CurrencyRate", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.CurrencyRate), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_SalesOrderHeader_CurrencyRate_CurrencyRateID", "CurrencyRate", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(AdventureWorksProcs.CurrencyRate), "SalesOrderHeader", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.SalesOrderHeader), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_Customer_SalesTerritory_TerritoryID", "SalesTerritory", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(AdventureWorksProcs.SalesTerritory), "Customer", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.Customer), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_CustomerAddress_Customer_CustomerID", "Customer", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Customer), "CustomerAddress", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.CustomerAddress), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_Individual_Customer_CustomerID", "Customer", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Customer), "Individual", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(AdventureWorksProcs.Individual), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Customer_CustomerID", "Customer", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Customer), "SalesOrderHeader", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.SalesOrderHeader), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_Store_Customer_CustomerID", "Customer", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Customer), "Store", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(AdventureWorksProcs.Store), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderHeader", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.SalesOrderHeader), "SalesOrderDetail", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.SalesOrderDetail), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID", "SpecialOfferProduct", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.SpecialOfferProduct), "SalesOrderDetail", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.SalesOrderDetail), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_SalesOrderHeader_SalesPerson_SalesPersonID", "SalesPerson", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(AdventureWorksProcs.SalesPerson), "SalesOrderHeader", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.SalesOrderHeader), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_SalesOrderHeader_SalesTerritory_TerritoryID", "SalesTerritory", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(AdventureWorksProcs.SalesTerritory), "SalesOrderHeader", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.SalesOrderHeader), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID", "SalesOrderHeader", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.SalesOrderHeader), "SalesOrderHeaderSalesReason", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.SalesOrderHeaderSalesReason), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID", "SalesReason", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.SalesReason), "SalesOrderHeaderSalesReason", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.SalesOrderHeaderSalesReason), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_SalesPerson_SalesTerritory_TerritoryID", "SalesTerritory", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(AdventureWorksProcs.SalesTerritory), "SalesPerson", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.SalesPerson), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_SalesPersonQuotaHistory_SalesPerson_SalesPersonID", "SalesPerson", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.SalesPerson), "SalesPersonQuotaHistory", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.SalesPersonQuotaHistory), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_SalesTerritoryHistory_SalesPerson_SalesPersonID", "SalesPerson", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.SalesPerson), "SalesTerritoryHistory", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.SalesTerritoryHistory), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_Store_SalesPerson_SalesPersonID", "SalesPerson", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(AdventureWorksProcs.SalesPerson), "Store", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.Store), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_SalesTerritoryHistory_SalesTerritory_TerritoryID", "SalesTerritory", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.SalesTerritory), "SalesTerritoryHistory", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.SalesTerritoryHistory), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID", "SpecialOffer", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.SpecialOffer), "SpecialOfferProduct", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.SpecialOfferProduct), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_StoreContact_Store_CustomerID", "Store", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(AdventureWorksProcs.Store), "StoreContact", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(AdventureWorksProcs.StoreContact), true)]

#endregion

namespace AdventureWorksProcs
{
    #region Contexts
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    public partial class AdventureWorksEntities : ObjectContext
    {
        #region Constructors
    
        /// <summary>
        /// Initializes a new AdventureWorksEntities object using the connection string found in the 'AdventureWorksEntities' section of the application configuration file.
        /// </summary>
        public AdventureWorksEntities() : base("name=AdventureWorksEntities", "AdventureWorksEntities")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }
    
        /// <summary>
        /// Initialize a new AdventureWorksEntities object.
        /// </summary>
        public AdventureWorksEntities(string connectionString) : base(connectionString, "AdventureWorksEntities")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }
    
        /// <summary>
        /// Initialize a new AdventureWorksEntities object.
        /// </summary>
        public AdventureWorksEntities(EntityConnection connection) : base(connection, "AdventureWorksEntities")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }
    
        #endregion
    
        #region Partial Methods
    
        partial void OnContextCreated();
    
        #endregion
    
        #region ObjectSet Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<AWBuildVersion> AWBuildVersions
        {
            get
            {
                if ((_AWBuildVersions == null))
                {
                    _AWBuildVersions = base.CreateObjectSet<AWBuildVersion>("AWBuildVersions");
                }
                return _AWBuildVersions;
            }
        }
        private ObjectSet<AWBuildVersion> _AWBuildVersions;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<DatabaseLog> DatabaseLogs
        {
            get
            {
                if ((_DatabaseLogs == null))
                {
                    _DatabaseLogs = base.CreateObjectSet<DatabaseLog>("DatabaseLogs");
                }
                return _DatabaseLogs;
            }
        }
        private ObjectSet<DatabaseLog> _DatabaseLogs;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<ErrorLog> ErrorLogs
        {
            get
            {
                if ((_ErrorLogs == null))
                {
                    _ErrorLogs = base.CreateObjectSet<ErrorLog>("ErrorLogs");
                }
                return _ErrorLogs;
            }
        }
        private ObjectSet<ErrorLog> _ErrorLogs;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<Department> Departments
        {
            get
            {
                if ((_Departments == null))
                {
                    _Departments = base.CreateObjectSet<Department>("Departments");
                }
                return _Departments;
            }
        }
        private ObjectSet<Department> _Departments;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<Employee> Employees
        {
            get
            {
                if ((_Employees == null))
                {
                    _Employees = base.CreateObjectSet<Employee>("Employees");
                }
                return _Employees;
            }
        }
        private ObjectSet<Employee> _Employees;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<EmployeeAddress> EmployeeAddresses
        {
            get
            {
                if ((_EmployeeAddresses == null))
                {
                    _EmployeeAddresses = base.CreateObjectSet<EmployeeAddress>("EmployeeAddresses");
                }
                return _EmployeeAddresses;
            }
        }
        private ObjectSet<EmployeeAddress> _EmployeeAddresses;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<EmployeeDepartmentHistory> EmployeeDepartmentHistories
        {
            get
            {
                if ((_EmployeeDepartmentHistories == null))
                {
                    _EmployeeDepartmentHistories = base.CreateObjectSet<EmployeeDepartmentHistory>("EmployeeDepartmentHistories");
                }
                return _EmployeeDepartmentHistories;
            }
        }
        private ObjectSet<EmployeeDepartmentHistory> _EmployeeDepartmentHistories;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<EmployeePayHistory> EmployeePayHistories
        {
            get
            {
                if ((_EmployeePayHistories == null))
                {
                    _EmployeePayHistories = base.CreateObjectSet<EmployeePayHistory>("EmployeePayHistories");
                }
                return _EmployeePayHistories;
            }
        }
        private ObjectSet<EmployeePayHistory> _EmployeePayHistories;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<JobCandidate> JobCandidates
        {
            get
            {
                if ((_JobCandidates == null))
                {
                    _JobCandidates = base.CreateObjectSet<JobCandidate>("JobCandidates");
                }
                return _JobCandidates;
            }
        }
        private ObjectSet<JobCandidate> _JobCandidates;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<Shift> Shifts
        {
            get
            {
                if ((_Shifts == null))
                {
                    _Shifts = base.CreateObjectSet<Shift>("Shifts");
                }
                return _Shifts;
            }
        }
        private ObjectSet<Shift> _Shifts;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<Address> Addresses
        {
            get
            {
                if ((_Addresses == null))
                {
                    _Addresses = base.CreateObjectSet<Address>("Addresses");
                }
                return _Addresses;
            }
        }
        private ObjectSet<Address> _Addresses;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<AddressType> AddressTypes
        {
            get
            {
                if ((_AddressTypes == null))
                {
                    _AddressTypes = base.CreateObjectSet<AddressType>("AddressTypes");
                }
                return _AddressTypes;
            }
        }
        private ObjectSet<AddressType> _AddressTypes;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<Contact> Contacts
        {
            get
            {
                if ((_Contacts == null))
                {
                    _Contacts = base.CreateObjectSet<Contact>("Contacts");
                }
                return _Contacts;
            }
        }
        private ObjectSet<Contact> _Contacts;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<ContactType> ContactTypes
        {
            get
            {
                if ((_ContactTypes == null))
                {
                    _ContactTypes = base.CreateObjectSet<ContactType>("ContactTypes");
                }
                return _ContactTypes;
            }
        }
        private ObjectSet<ContactType> _ContactTypes;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<CountryRegion> CountryRegions
        {
            get
            {
                if ((_CountryRegions == null))
                {
                    _CountryRegions = base.CreateObjectSet<CountryRegion>("CountryRegions");
                }
                return _CountryRegions;
            }
        }
        private ObjectSet<CountryRegion> _CountryRegions;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<StateProvince> StateProvinces
        {
            get
            {
                if ((_StateProvinces == null))
                {
                    _StateProvinces = base.CreateObjectSet<StateProvince>("StateProvinces");
                }
                return _StateProvinces;
            }
        }
        private ObjectSet<StateProvince> _StateProvinces;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<BillOfMaterial> BillOfMaterials
        {
            get
            {
                if ((_BillOfMaterials == null))
                {
                    _BillOfMaterials = base.CreateObjectSet<BillOfMaterial>("BillOfMaterials");
                }
                return _BillOfMaterials;
            }
        }
        private ObjectSet<BillOfMaterial> _BillOfMaterials;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<Culture> Cultures
        {
            get
            {
                if ((_Cultures == null))
                {
                    _Cultures = base.CreateObjectSet<Culture>("Cultures");
                }
                return _Cultures;
            }
        }
        private ObjectSet<Culture> _Cultures;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<Document> Documents
        {
            get
            {
                if ((_Documents == null))
                {
                    _Documents = base.CreateObjectSet<Document>("Documents");
                }
                return _Documents;
            }
        }
        private ObjectSet<Document> _Documents;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<Illustration> Illustrations
        {
            get
            {
                if ((_Illustrations == null))
                {
                    _Illustrations = base.CreateObjectSet<Illustration>("Illustrations");
                }
                return _Illustrations;
            }
        }
        private ObjectSet<Illustration> _Illustrations;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<Location> Locations
        {
            get
            {
                if ((_Locations == null))
                {
                    _Locations = base.CreateObjectSet<Location>("Locations");
                }
                return _Locations;
            }
        }
        private ObjectSet<Location> _Locations;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<Product> Products
        {
            get
            {
                if ((_Products == null))
                {
                    _Products = base.CreateObjectSet<Product>("Products");
                }
                return _Products;
            }
        }
        private ObjectSet<Product> _Products;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<ProductCategory> ProductCategories
        {
            get
            {
                if ((_ProductCategories == null))
                {
                    _ProductCategories = base.CreateObjectSet<ProductCategory>("ProductCategories");
                }
                return _ProductCategories;
            }
        }
        private ObjectSet<ProductCategory> _ProductCategories;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<ProductCostHistory> ProductCostHistories
        {
            get
            {
                if ((_ProductCostHistories == null))
                {
                    _ProductCostHistories = base.CreateObjectSet<ProductCostHistory>("ProductCostHistories");
                }
                return _ProductCostHistories;
            }
        }
        private ObjectSet<ProductCostHistory> _ProductCostHistories;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<ProductDescription> ProductDescriptions
        {
            get
            {
                if ((_ProductDescriptions == null))
                {
                    _ProductDescriptions = base.CreateObjectSet<ProductDescription>("ProductDescriptions");
                }
                return _ProductDescriptions;
            }
        }
        private ObjectSet<ProductDescription> _ProductDescriptions;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<ProductDocument> ProductDocuments
        {
            get
            {
                if ((_ProductDocuments == null))
                {
                    _ProductDocuments = base.CreateObjectSet<ProductDocument>("ProductDocuments");
                }
                return _ProductDocuments;
            }
        }
        private ObjectSet<ProductDocument> _ProductDocuments;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<ProductInventory> ProductInventories
        {
            get
            {
                if ((_ProductInventories == null))
                {
                    _ProductInventories = base.CreateObjectSet<ProductInventory>("ProductInventories");
                }
                return _ProductInventories;
            }
        }
        private ObjectSet<ProductInventory> _ProductInventories;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<ProductListPriceHistory> ProductListPriceHistories
        {
            get
            {
                if ((_ProductListPriceHistories == null))
                {
                    _ProductListPriceHistories = base.CreateObjectSet<ProductListPriceHistory>("ProductListPriceHistories");
                }
                return _ProductListPriceHistories;
            }
        }
        private ObjectSet<ProductListPriceHistory> _ProductListPriceHistories;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<ProductModel> ProductModels
        {
            get
            {
                if ((_ProductModels == null))
                {
                    _ProductModels = base.CreateObjectSet<ProductModel>("ProductModels");
                }
                return _ProductModels;
            }
        }
        private ObjectSet<ProductModel> _ProductModels;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<ProductModelIllustration> ProductModelIllustrations
        {
            get
            {
                if ((_ProductModelIllustrations == null))
                {
                    _ProductModelIllustrations = base.CreateObjectSet<ProductModelIllustration>("ProductModelIllustrations");
                }
                return _ProductModelIllustrations;
            }
        }
        private ObjectSet<ProductModelIllustration> _ProductModelIllustrations;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<ProductModelProductDescriptionCulture> ProductModelProductDescriptionCultures
        {
            get
            {
                if ((_ProductModelProductDescriptionCultures == null))
                {
                    _ProductModelProductDescriptionCultures = base.CreateObjectSet<ProductModelProductDescriptionCulture>("ProductModelProductDescriptionCultures");
                }
                return _ProductModelProductDescriptionCultures;
            }
        }
        private ObjectSet<ProductModelProductDescriptionCulture> _ProductModelProductDescriptionCultures;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<ProductPhoto> ProductPhotoes
        {
            get
            {
                if ((_ProductPhotoes == null))
                {
                    _ProductPhotoes = base.CreateObjectSet<ProductPhoto>("ProductPhotoes");
                }
                return _ProductPhotoes;
            }
        }
        private ObjectSet<ProductPhoto> _ProductPhotoes;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<ProductProductPhoto> ProductProductPhotoes
        {
            get
            {
                if ((_ProductProductPhotoes == null))
                {
                    _ProductProductPhotoes = base.CreateObjectSet<ProductProductPhoto>("ProductProductPhotoes");
                }
                return _ProductProductPhotoes;
            }
        }
        private ObjectSet<ProductProductPhoto> _ProductProductPhotoes;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<ProductReview> ProductReviews
        {
            get
            {
                if ((_ProductReviews == null))
                {
                    _ProductReviews = base.CreateObjectSet<ProductReview>("ProductReviews");
                }
                return _ProductReviews;
            }
        }
        private ObjectSet<ProductReview> _ProductReviews;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<ProductSubcategory> ProductSubcategories
        {
            get
            {
                if ((_ProductSubcategories == null))
                {
                    _ProductSubcategories = base.CreateObjectSet<ProductSubcategory>("ProductSubcategories");
                }
                return _ProductSubcategories;
            }
        }
        private ObjectSet<ProductSubcategory> _ProductSubcategories;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<ScrapReason> ScrapReasons
        {
            get
            {
                if ((_ScrapReasons == null))
                {
                    _ScrapReasons = base.CreateObjectSet<ScrapReason>("ScrapReasons");
                }
                return _ScrapReasons;
            }
        }
        private ObjectSet<ScrapReason> _ScrapReasons;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<TransactionHistory> TransactionHistories
        {
            get
            {
                if ((_TransactionHistories == null))
                {
                    _TransactionHistories = base.CreateObjectSet<TransactionHistory>("TransactionHistories");
                }
                return _TransactionHistories;
            }
        }
        private ObjectSet<TransactionHistory> _TransactionHistories;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<TransactionHistoryArchive> TransactionHistoryArchives
        {
            get
            {
                if ((_TransactionHistoryArchives == null))
                {
                    _TransactionHistoryArchives = base.CreateObjectSet<TransactionHistoryArchive>("TransactionHistoryArchives");
                }
                return _TransactionHistoryArchives;
            }
        }
        private ObjectSet<TransactionHistoryArchive> _TransactionHistoryArchives;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<UnitMeasure> UnitMeasures
        {
            get
            {
                if ((_UnitMeasures == null))
                {
                    _UnitMeasures = base.CreateObjectSet<UnitMeasure>("UnitMeasures");
                }
                return _UnitMeasures;
            }
        }
        private ObjectSet<UnitMeasure> _UnitMeasures;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<WorkOrder> WorkOrders
        {
            get
            {
                if ((_WorkOrders == null))
                {
                    _WorkOrders = base.CreateObjectSet<WorkOrder>("WorkOrders");
                }
                return _WorkOrders;
            }
        }
        private ObjectSet<WorkOrder> _WorkOrders;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<WorkOrderRouting> WorkOrderRoutings
        {
            get
            {
                if ((_WorkOrderRoutings == null))
                {
                    _WorkOrderRoutings = base.CreateObjectSet<WorkOrderRouting>("WorkOrderRoutings");
                }
                return _WorkOrderRoutings;
            }
        }
        private ObjectSet<WorkOrderRouting> _WorkOrderRoutings;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<ProductVendor> ProductVendors
        {
            get
            {
                if ((_ProductVendors == null))
                {
                    _ProductVendors = base.CreateObjectSet<ProductVendor>("ProductVendors");
                }
                return _ProductVendors;
            }
        }
        private ObjectSet<ProductVendor> _ProductVendors;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<PurchaseOrderDetail> PurchaseOrderDetails
        {
            get
            {
                if ((_PurchaseOrderDetails == null))
                {
                    _PurchaseOrderDetails = base.CreateObjectSet<PurchaseOrderDetail>("PurchaseOrderDetails");
                }
                return _PurchaseOrderDetails;
            }
        }
        private ObjectSet<PurchaseOrderDetail> _PurchaseOrderDetails;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<PurchaseOrderHeader> PurchaseOrderHeaders
        {
            get
            {
                if ((_PurchaseOrderHeaders == null))
                {
                    _PurchaseOrderHeaders = base.CreateObjectSet<PurchaseOrderHeader>("PurchaseOrderHeaders");
                }
                return _PurchaseOrderHeaders;
            }
        }
        private ObjectSet<PurchaseOrderHeader> _PurchaseOrderHeaders;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<ShipMethod> ShipMethods
        {
            get
            {
                if ((_ShipMethods == null))
                {
                    _ShipMethods = base.CreateObjectSet<ShipMethod>("ShipMethods");
                }
                return _ShipMethods;
            }
        }
        private ObjectSet<ShipMethod> _ShipMethods;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<Vendor> Vendors
        {
            get
            {
                if ((_Vendors == null))
                {
                    _Vendors = base.CreateObjectSet<Vendor>("Vendors");
                }
                return _Vendors;
            }
        }
        private ObjectSet<Vendor> _Vendors;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<VendorAddress> VendorAddresses
        {
            get
            {
                if ((_VendorAddresses == null))
                {
                    _VendorAddresses = base.CreateObjectSet<VendorAddress>("VendorAddresses");
                }
                return _VendorAddresses;
            }
        }
        private ObjectSet<VendorAddress> _VendorAddresses;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<VendorContact> VendorContacts
        {
            get
            {
                if ((_VendorContacts == null))
                {
                    _VendorContacts = base.CreateObjectSet<VendorContact>("VendorContacts");
                }
                return _VendorContacts;
            }
        }
        private ObjectSet<VendorContact> _VendorContacts;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<ContactCreditCard> ContactCreditCards
        {
            get
            {
                if ((_ContactCreditCards == null))
                {
                    _ContactCreditCards = base.CreateObjectSet<ContactCreditCard>("ContactCreditCards");
                }
                return _ContactCreditCards;
            }
        }
        private ObjectSet<ContactCreditCard> _ContactCreditCards;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<CountryRegionCurrency> CountryRegionCurrencies
        {
            get
            {
                if ((_CountryRegionCurrencies == null))
                {
                    _CountryRegionCurrencies = base.CreateObjectSet<CountryRegionCurrency>("CountryRegionCurrencies");
                }
                return _CountryRegionCurrencies;
            }
        }
        private ObjectSet<CountryRegionCurrency> _CountryRegionCurrencies;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<CreditCard> CreditCards
        {
            get
            {
                if ((_CreditCards == null))
                {
                    _CreditCards = base.CreateObjectSet<CreditCard>("CreditCards");
                }
                return _CreditCards;
            }
        }
        private ObjectSet<CreditCard> _CreditCards;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<Currency> Currencies
        {
            get
            {
                if ((_Currencies == null))
                {
                    _Currencies = base.CreateObjectSet<Currency>("Currencies");
                }
                return _Currencies;
            }
        }
        private ObjectSet<Currency> _Currencies;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<CurrencyRate> CurrencyRates
        {
            get
            {
                if ((_CurrencyRates == null))
                {
                    _CurrencyRates = base.CreateObjectSet<CurrencyRate>("CurrencyRates");
                }
                return _CurrencyRates;
            }
        }
        private ObjectSet<CurrencyRate> _CurrencyRates;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<Customer> Customers
        {
            get
            {
                if ((_Customers == null))
                {
                    _Customers = base.CreateObjectSet<Customer>("Customers");
                }
                return _Customers;
            }
        }
        private ObjectSet<Customer> _Customers;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<CustomerAddress> CustomerAddresses
        {
            get
            {
                if ((_CustomerAddresses == null))
                {
                    _CustomerAddresses = base.CreateObjectSet<CustomerAddress>("CustomerAddresses");
                }
                return _CustomerAddresses;
            }
        }
        private ObjectSet<CustomerAddress> _CustomerAddresses;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<Individual> Individuals
        {
            get
            {
                if ((_Individuals == null))
                {
                    _Individuals = base.CreateObjectSet<Individual>("Individuals");
                }
                return _Individuals;
            }
        }
        private ObjectSet<Individual> _Individuals;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<SalesOrderDetail> SalesOrderDetails
        {
            get
            {
                if ((_SalesOrderDetails == null))
                {
                    _SalesOrderDetails = base.CreateObjectSet<SalesOrderDetail>("SalesOrderDetails");
                }
                return _SalesOrderDetails;
            }
        }
        private ObjectSet<SalesOrderDetail> _SalesOrderDetails;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<SalesOrderHeader> SalesOrderHeaders
        {
            get
            {
                if ((_SalesOrderHeaders == null))
                {
                    _SalesOrderHeaders = base.CreateObjectSet<SalesOrderHeader>("SalesOrderHeaders");
                }
                return _SalesOrderHeaders;
            }
        }
        private ObjectSet<SalesOrderHeader> _SalesOrderHeaders;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<SalesOrderHeaderSalesReason> SalesOrderHeaderSalesReasons
        {
            get
            {
                if ((_SalesOrderHeaderSalesReasons == null))
                {
                    _SalesOrderHeaderSalesReasons = base.CreateObjectSet<SalesOrderHeaderSalesReason>("SalesOrderHeaderSalesReasons");
                }
                return _SalesOrderHeaderSalesReasons;
            }
        }
        private ObjectSet<SalesOrderHeaderSalesReason> _SalesOrderHeaderSalesReasons;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<SalesPerson> SalesPersons
        {
            get
            {
                if ((_SalesPersons == null))
                {
                    _SalesPersons = base.CreateObjectSet<SalesPerson>("SalesPersons");
                }
                return _SalesPersons;
            }
        }
        private ObjectSet<SalesPerson> _SalesPersons;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<SalesPersonQuotaHistory> SalesPersonQuotaHistories
        {
            get
            {
                if ((_SalesPersonQuotaHistories == null))
                {
                    _SalesPersonQuotaHistories = base.CreateObjectSet<SalesPersonQuotaHistory>("SalesPersonQuotaHistories");
                }
                return _SalesPersonQuotaHistories;
            }
        }
        private ObjectSet<SalesPersonQuotaHistory> _SalesPersonQuotaHistories;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<SalesReason> SalesReasons
        {
            get
            {
                if ((_SalesReasons == null))
                {
                    _SalesReasons = base.CreateObjectSet<SalesReason>("SalesReasons");
                }
                return _SalesReasons;
            }
        }
        private ObjectSet<SalesReason> _SalesReasons;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<SalesTaxRate> SalesTaxRates
        {
            get
            {
                if ((_SalesTaxRates == null))
                {
                    _SalesTaxRates = base.CreateObjectSet<SalesTaxRate>("SalesTaxRates");
                }
                return _SalesTaxRates;
            }
        }
        private ObjectSet<SalesTaxRate> _SalesTaxRates;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<SalesTerritory> SalesTerritories
        {
            get
            {
                if ((_SalesTerritories == null))
                {
                    _SalesTerritories = base.CreateObjectSet<SalesTerritory>("SalesTerritories");
                }
                return _SalesTerritories;
            }
        }
        private ObjectSet<SalesTerritory> _SalesTerritories;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<SalesTerritoryHistory> SalesTerritoryHistories
        {
            get
            {
                if ((_SalesTerritoryHistories == null))
                {
                    _SalesTerritoryHistories = base.CreateObjectSet<SalesTerritoryHistory>("SalesTerritoryHistories");
                }
                return _SalesTerritoryHistories;
            }
        }
        private ObjectSet<SalesTerritoryHistory> _SalesTerritoryHistories;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<ShoppingCartItem> ShoppingCartItems
        {
            get
            {
                if ((_ShoppingCartItems == null))
                {
                    _ShoppingCartItems = base.CreateObjectSet<ShoppingCartItem>("ShoppingCartItems");
                }
                return _ShoppingCartItems;
            }
        }
        private ObjectSet<ShoppingCartItem> _ShoppingCartItems;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<SpecialOffer> SpecialOffers
        {
            get
            {
                if ((_SpecialOffers == null))
                {
                    _SpecialOffers = base.CreateObjectSet<SpecialOffer>("SpecialOffers");
                }
                return _SpecialOffers;
            }
        }
        private ObjectSet<SpecialOffer> _SpecialOffers;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<SpecialOfferProduct> SpecialOfferProducts
        {
            get
            {
                if ((_SpecialOfferProducts == null))
                {
                    _SpecialOfferProducts = base.CreateObjectSet<SpecialOfferProduct>("SpecialOfferProducts");
                }
                return _SpecialOfferProducts;
            }
        }
        private ObjectSet<SpecialOfferProduct> _SpecialOfferProducts;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<Store> Stores
        {
            get
            {
                if ((_Stores == null))
                {
                    _Stores = base.CreateObjectSet<Store>("Stores");
                }
                return _Stores;
            }
        }
        private ObjectSet<Store> _Stores;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<StoreContact> StoreContacts
        {
            get
            {
                if ((_StoreContacts == null))
                {
                    _StoreContacts = base.CreateObjectSet<StoreContact>("StoreContacts");
                }
                return _StoreContacts;
            }
        }
        private ObjectSet<StoreContact> _StoreContacts;

        #endregion
        #region AddTo Methods
    
        /// <summary>
        /// Deprecated Method for adding a new object to the AWBuildVersions EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToAWBuildVersions(AWBuildVersion aWBuildVersion)
        {
            base.AddObject("AWBuildVersions", aWBuildVersion);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the DatabaseLogs EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToDatabaseLogs(DatabaseLog databaseLog)
        {
            base.AddObject("DatabaseLogs", databaseLog);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the ErrorLogs EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToErrorLogs(ErrorLog errorLog)
        {
            base.AddObject("ErrorLogs", errorLog);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the Departments EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToDepartments(Department department)
        {
            base.AddObject("Departments", department);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the Employees EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToEmployees(Employee employee)
        {
            base.AddObject("Employees", employee);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the EmployeeAddresses EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToEmployeeAddresses(EmployeeAddress employeeAddress)
        {
            base.AddObject("EmployeeAddresses", employeeAddress);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the EmployeeDepartmentHistories EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToEmployeeDepartmentHistories(EmployeeDepartmentHistory employeeDepartmentHistory)
        {
            base.AddObject("EmployeeDepartmentHistories", employeeDepartmentHistory);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the EmployeePayHistories EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToEmployeePayHistories(EmployeePayHistory employeePayHistory)
        {
            base.AddObject("EmployeePayHistories", employeePayHistory);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the JobCandidates EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToJobCandidates(JobCandidate jobCandidate)
        {
            base.AddObject("JobCandidates", jobCandidate);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the Shifts EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToShifts(Shift shift)
        {
            base.AddObject("Shifts", shift);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the Addresses EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToAddresses(Address address)
        {
            base.AddObject("Addresses", address);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the AddressTypes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToAddressTypes(AddressType addressType)
        {
            base.AddObject("AddressTypes", addressType);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the Contacts EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToContacts(Contact contact)
        {
            base.AddObject("Contacts", contact);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the ContactTypes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToContactTypes(ContactType contactType)
        {
            base.AddObject("ContactTypes", contactType);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the CountryRegions EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToCountryRegions(CountryRegion countryRegion)
        {
            base.AddObject("CountryRegions", countryRegion);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the StateProvinces EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToStateProvinces(StateProvince stateProvince)
        {
            base.AddObject("StateProvinces", stateProvince);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the BillOfMaterials EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToBillOfMaterials(BillOfMaterial billOfMaterial)
        {
            base.AddObject("BillOfMaterials", billOfMaterial);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the Cultures EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToCultures(Culture culture)
        {
            base.AddObject("Cultures", culture);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the Documents EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToDocuments(Document document)
        {
            base.AddObject("Documents", document);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the Illustrations EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToIllustrations(Illustration illustration)
        {
            base.AddObject("Illustrations", illustration);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the Locations EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToLocations(Location location)
        {
            base.AddObject("Locations", location);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the Products EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToProducts(Product product)
        {
            base.AddObject("Products", product);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the ProductCategories EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToProductCategories(ProductCategory productCategory)
        {
            base.AddObject("ProductCategories", productCategory);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the ProductCostHistories EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToProductCostHistories(ProductCostHistory productCostHistory)
        {
            base.AddObject("ProductCostHistories", productCostHistory);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the ProductDescriptions EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToProductDescriptions(ProductDescription productDescription)
        {
            base.AddObject("ProductDescriptions", productDescription);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the ProductDocuments EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToProductDocuments(ProductDocument productDocument)
        {
            base.AddObject("ProductDocuments", productDocument);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the ProductInventories EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToProductInventories(ProductInventory productInventory)
        {
            base.AddObject("ProductInventories", productInventory);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the ProductListPriceHistories EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToProductListPriceHistories(ProductListPriceHistory productListPriceHistory)
        {
            base.AddObject("ProductListPriceHistories", productListPriceHistory);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the ProductModels EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToProductModels(ProductModel productModel)
        {
            base.AddObject("ProductModels", productModel);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the ProductModelIllustrations EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToProductModelIllustrations(ProductModelIllustration productModelIllustration)
        {
            base.AddObject("ProductModelIllustrations", productModelIllustration);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the ProductModelProductDescriptionCultures EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToProductModelProductDescriptionCultures(ProductModelProductDescriptionCulture productModelProductDescriptionCulture)
        {
            base.AddObject("ProductModelProductDescriptionCultures", productModelProductDescriptionCulture);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the ProductPhotoes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToProductPhotoes(ProductPhoto productPhoto)
        {
            base.AddObject("ProductPhotoes", productPhoto);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the ProductProductPhotoes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToProductProductPhotoes(ProductProductPhoto productProductPhoto)
        {
            base.AddObject("ProductProductPhotoes", productProductPhoto);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the ProductReviews EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToProductReviews(ProductReview productReview)
        {
            base.AddObject("ProductReviews", productReview);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the ProductSubcategories EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToProductSubcategories(ProductSubcategory productSubcategory)
        {
            base.AddObject("ProductSubcategories", productSubcategory);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the ScrapReasons EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToScrapReasons(ScrapReason scrapReason)
        {
            base.AddObject("ScrapReasons", scrapReason);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the TransactionHistories EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToTransactionHistories(TransactionHistory transactionHistory)
        {
            base.AddObject("TransactionHistories", transactionHistory);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the TransactionHistoryArchives EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToTransactionHistoryArchives(TransactionHistoryArchive transactionHistoryArchive)
        {
            base.AddObject("TransactionHistoryArchives", transactionHistoryArchive);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the UnitMeasures EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToUnitMeasures(UnitMeasure unitMeasure)
        {
            base.AddObject("UnitMeasures", unitMeasure);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the WorkOrders EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToWorkOrders(WorkOrder workOrder)
        {
            base.AddObject("WorkOrders", workOrder);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the WorkOrderRoutings EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToWorkOrderRoutings(WorkOrderRouting workOrderRouting)
        {
            base.AddObject("WorkOrderRoutings", workOrderRouting);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the ProductVendors EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToProductVendors(ProductVendor productVendor)
        {
            base.AddObject("ProductVendors", productVendor);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the PurchaseOrderDetails EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToPurchaseOrderDetails(PurchaseOrderDetail purchaseOrderDetail)
        {
            base.AddObject("PurchaseOrderDetails", purchaseOrderDetail);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the PurchaseOrderHeaders EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToPurchaseOrderHeaders(PurchaseOrderHeader purchaseOrderHeader)
        {
            base.AddObject("PurchaseOrderHeaders", purchaseOrderHeader);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the ShipMethods EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToShipMethods(ShipMethod shipMethod)
        {
            base.AddObject("ShipMethods", shipMethod);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the Vendors EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToVendors(Vendor vendor)
        {
            base.AddObject("Vendors", vendor);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the VendorAddresses EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToVendorAddresses(VendorAddress vendorAddress)
        {
            base.AddObject("VendorAddresses", vendorAddress);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the VendorContacts EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToVendorContacts(VendorContact vendorContact)
        {
            base.AddObject("VendorContacts", vendorContact);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the ContactCreditCards EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToContactCreditCards(ContactCreditCard contactCreditCard)
        {
            base.AddObject("ContactCreditCards", contactCreditCard);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the CountryRegionCurrencies EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToCountryRegionCurrencies(CountryRegionCurrency countryRegionCurrency)
        {
            base.AddObject("CountryRegionCurrencies", countryRegionCurrency);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the CreditCards EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToCreditCards(CreditCard creditCard)
        {
            base.AddObject("CreditCards", creditCard);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the Currencies EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToCurrencies(Currency currency)
        {
            base.AddObject("Currencies", currency);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the CurrencyRates EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToCurrencyRates(CurrencyRate currencyRate)
        {
            base.AddObject("CurrencyRates", currencyRate);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the Customers EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToCustomers(Customer customer)
        {
            base.AddObject("Customers", customer);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the CustomerAddresses EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToCustomerAddresses(CustomerAddress customerAddress)
        {
            base.AddObject("CustomerAddresses", customerAddress);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the Individuals EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToIndividuals(Individual individual)
        {
            base.AddObject("Individuals", individual);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the SalesOrderDetails EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToSalesOrderDetails(SalesOrderDetail salesOrderDetail)
        {
            base.AddObject("SalesOrderDetails", salesOrderDetail);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the SalesOrderHeaders EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToSalesOrderHeaders(SalesOrderHeader salesOrderHeader)
        {
            base.AddObject("SalesOrderHeaders", salesOrderHeader);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the SalesOrderHeaderSalesReasons EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToSalesOrderHeaderSalesReasons(SalesOrderHeaderSalesReason salesOrderHeaderSalesReason)
        {
            base.AddObject("SalesOrderHeaderSalesReasons", salesOrderHeaderSalesReason);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the SalesPersons EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToSalesPersons(SalesPerson salesPerson)
        {
            base.AddObject("SalesPersons", salesPerson);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the SalesPersonQuotaHistories EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToSalesPersonQuotaHistories(SalesPersonQuotaHistory salesPersonQuotaHistory)
        {
            base.AddObject("SalesPersonQuotaHistories", salesPersonQuotaHistory);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the SalesReasons EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToSalesReasons(SalesReason salesReason)
        {
            base.AddObject("SalesReasons", salesReason);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the SalesTaxRates EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToSalesTaxRates(SalesTaxRate salesTaxRate)
        {
            base.AddObject("SalesTaxRates", salesTaxRate);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the SalesTerritories EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToSalesTerritories(SalesTerritory salesTerritory)
        {
            base.AddObject("SalesTerritories", salesTerritory);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the SalesTerritoryHistories EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToSalesTerritoryHistories(SalesTerritoryHistory salesTerritoryHistory)
        {
            base.AddObject("SalesTerritoryHistories", salesTerritoryHistory);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the ShoppingCartItems EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToShoppingCartItems(ShoppingCartItem shoppingCartItem)
        {
            base.AddObject("ShoppingCartItems", shoppingCartItem);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the SpecialOffers EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToSpecialOffers(SpecialOffer specialOffer)
        {
            base.AddObject("SpecialOffers", specialOffer);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the SpecialOfferProducts EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToSpecialOfferProducts(SpecialOfferProduct specialOfferProduct)
        {
            base.AddObject("SpecialOfferProducts", specialOfferProduct);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the Stores EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToStores(Store store)
        {
            base.AddObject("Stores", store);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the StoreContacts EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToStoreContacts(StoreContact storeContact)
        {
            base.AddObject("StoreContacts", storeContact);
        }

        #endregion
        #region Function Imports
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        /// <param name="startOrderDate">No Metadata Documentation available.</param>
        public ObjectResult<GetOrders_Result> GetOrders(Nullable<global::System.DateTime> startOrderDate)
        {
            ObjectParameter startOrderDateParameter;
            if (startOrderDate.HasValue)
            {
                startOrderDateParameter = new ObjectParameter("StartOrderDate", startOrderDate);
            }
            else
            {
                startOrderDateParameter = new ObjectParameter("StartOrderDate", typeof(global::System.DateTime));
            }
    
            return base.ExecuteFunction<GetOrders_Result>("GetOrders", startOrderDateParameter);
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        /// <param name="startOrderDate">No Metadata Documentation available.</param>
        public ObjectResult<GetOrdersHeader_Result> GetOrdersHeader(Nullable<global::System.DateTime> startOrderDate)
        {
            ObjectParameter startOrderDateParameter;
            if (startOrderDate.HasValue)
            {
                startOrderDateParameter = new ObjectParameter("StartOrderDate", startOrderDate);
            }
            else
            {
                startOrderDateParameter = new ObjectParameter("StartOrderDate", typeof(global::System.DateTime));
            }
    
            return base.ExecuteFunction<GetOrdersHeader_Result>("GetOrdersHeader", startOrderDateParameter);
        }

        #endregion
    }
    

    #endregion
    
    #region Entities
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="Address")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class Address : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new Address object.
        /// </summary>
        /// <param name="addressID">Initial value of the AddressID property.</param>
        /// <param name="addressLine1">Initial value of the AddressLine1 property.</param>
        /// <param name="city">Initial value of the City property.</param>
        /// <param name="stateProvinceID">Initial value of the StateProvinceID property.</param>
        /// <param name="postalCode">Initial value of the PostalCode property.</param>
        /// <param name="rowguid">Initial value of the rowguid property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static Address CreateAddress(global::System.Int32 addressID, global::System.String addressLine1, global::System.String city, global::System.Int32 stateProvinceID, global::System.String postalCode, global::System.Guid rowguid, global::System.DateTime modifiedDate)
        {
            Address address = new Address();
            address.AddressID = addressID;
            address.AddressLine1 = addressLine1;
            address.City = city;
            address.StateProvinceID = stateProvinceID;
            address.PostalCode = postalCode;
            address.rowguid = rowguid;
            address.ModifiedDate = modifiedDate;
            return address;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 AddressID
        {
            get
            {
                return _AddressID;
            }
            set
            {
                if (_AddressID != value)
                {
                    OnAddressIDChanging(value);
                    ReportPropertyChanging("AddressID");
                    _AddressID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("AddressID");
                    OnAddressIDChanged();
                }
            }
        }
        private global::System.Int32 _AddressID;
        partial void OnAddressIDChanging(global::System.Int32 value);
        partial void OnAddressIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String AddressLine1
        {
            get
            {
                return _AddressLine1;
            }
            set
            {
                OnAddressLine1Changing(value);
                ReportPropertyChanging("AddressLine1");
                _AddressLine1 = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("AddressLine1");
                OnAddressLine1Changed();
            }
        }
        private global::System.String _AddressLine1;
        partial void OnAddressLine1Changing(global::System.String value);
        partial void OnAddressLine1Changed();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String AddressLine2
        {
            get
            {
                return _AddressLine2;
            }
            set
            {
                OnAddressLine2Changing(value);
                ReportPropertyChanging("AddressLine2");
                _AddressLine2 = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("AddressLine2");
                OnAddressLine2Changed();
            }
        }
        private global::System.String _AddressLine2;
        partial void OnAddressLine2Changing(global::System.String value);
        partial void OnAddressLine2Changed();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String City
        {
            get
            {
                return _City;
            }
            set
            {
                OnCityChanging(value);
                ReportPropertyChanging("City");
                _City = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("City");
                OnCityChanged();
            }
        }
        private global::System.String _City;
        partial void OnCityChanging(global::System.String value);
        partial void OnCityChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 StateProvinceID
        {
            get
            {
                return _StateProvinceID;
            }
            set
            {
                OnStateProvinceIDChanging(value);
                ReportPropertyChanging("StateProvinceID");
                _StateProvinceID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("StateProvinceID");
                OnStateProvinceIDChanged();
            }
        }
        private global::System.Int32 _StateProvinceID;
        partial void OnStateProvinceIDChanging(global::System.Int32 value);
        partial void OnStateProvinceIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String PostalCode
        {
            get
            {
                return _PostalCode;
            }
            set
            {
                OnPostalCodeChanging(value);
                ReportPropertyChanging("PostalCode");
                _PostalCode = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("PostalCode");
                OnPostalCodeChanged();
            }
        }
        private global::System.String _PostalCode;
        partial void OnPostalCodeChanging(global::System.String value);
        partial void OnPostalCodeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Guid rowguid
        {
            get
            {
                return _rowguid;
            }
            set
            {
                OnrowguidChanging(value);
                ReportPropertyChanging("rowguid");
                _rowguid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("rowguid");
                OnrowguidChanged();
            }
        }
        private global::System.Guid _rowguid;
        partial void OnrowguidChanging(global::System.Guid value);
        partial void OnrowguidChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_EmployeeAddress_Address_AddressID", "EmployeeAddress")]
        public EntityCollection<EmployeeAddress> EmployeeAddresses
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<EmployeeAddress>("AdventureWorksModel.FK_EmployeeAddress_Address_AddressID", "EmployeeAddress");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<EmployeeAddress>("AdventureWorksModel.FK_EmployeeAddress_Address_AddressID", "EmployeeAddress", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_Address_StateProvince_StateProvinceID", "StateProvince")]
        public StateProvince StateProvince
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<StateProvince>("AdventureWorksModel.FK_Address_StateProvince_StateProvinceID", "StateProvince").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<StateProvince>("AdventureWorksModel.FK_Address_StateProvince_StateProvinceID", "StateProvince").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<StateProvince> StateProvinceReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<StateProvince>("AdventureWorksModel.FK_Address_StateProvince_StateProvinceID", "StateProvince");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<StateProvince>("AdventureWorksModel.FK_Address_StateProvince_StateProvinceID", "StateProvince", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_CustomerAddress_Address_AddressID", "CustomerAddress")]
        public EntityCollection<CustomerAddress> CustomerAddresses
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<CustomerAddress>("AdventureWorksModel.FK_CustomerAddress_Address_AddressID", "CustomerAddress");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<CustomerAddress>("AdventureWorksModel.FK_CustomerAddress_Address_AddressID", "CustomerAddress", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Address_BillToAddressID", "SalesOrderHeader")]
        public EntityCollection<SalesOrderHeader> SalesOrderHeaders
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<SalesOrderHeader>("AdventureWorksModel.FK_SalesOrderHeader_Address_BillToAddressID", "SalesOrderHeader");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<SalesOrderHeader>("AdventureWorksModel.FK_SalesOrderHeader_Address_BillToAddressID", "SalesOrderHeader", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Address_ShipToAddressID", "SalesOrderHeader")]
        public EntityCollection<SalesOrderHeader> SalesOrderHeaders1
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<SalesOrderHeader>("AdventureWorksModel.FK_SalesOrderHeader_Address_ShipToAddressID", "SalesOrderHeader");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<SalesOrderHeader>("AdventureWorksModel.FK_SalesOrderHeader_Address_ShipToAddressID", "SalesOrderHeader", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_VendorAddress_Address_AddressID", "VendorAddress")]
        public EntityCollection<VendorAddress> VendorAddresses
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<VendorAddress>("AdventureWorksModel.FK_VendorAddress_Address_AddressID", "VendorAddress");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<VendorAddress>("AdventureWorksModel.FK_VendorAddress_Address_AddressID", "VendorAddress", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="AddressType")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class AddressType : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new AddressType object.
        /// </summary>
        /// <param name="addressTypeID">Initial value of the AddressTypeID property.</param>
        /// <param name="name">Initial value of the Name property.</param>
        /// <param name="rowguid">Initial value of the rowguid property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static AddressType CreateAddressType(global::System.Int32 addressTypeID, global::System.String name, global::System.Guid rowguid, global::System.DateTime modifiedDate)
        {
            AddressType addressType = new AddressType();
            addressType.AddressTypeID = addressTypeID;
            addressType.Name = name;
            addressType.rowguid = rowguid;
            addressType.ModifiedDate = modifiedDate;
            return addressType;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 AddressTypeID
        {
            get
            {
                return _AddressTypeID;
            }
            set
            {
                if (_AddressTypeID != value)
                {
                    OnAddressTypeIDChanging(value);
                    ReportPropertyChanging("AddressTypeID");
                    _AddressTypeID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("AddressTypeID");
                    OnAddressTypeIDChanged();
                }
            }
        }
        private global::System.Int32 _AddressTypeID;
        partial void OnAddressTypeIDChanging(global::System.Int32 value);
        partial void OnAddressTypeIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Name
        {
            get
            {
                return _Name;
            }
            set
            {
                OnNameChanging(value);
                ReportPropertyChanging("Name");
                _Name = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Name");
                OnNameChanged();
            }
        }
        private global::System.String _Name;
        partial void OnNameChanging(global::System.String value);
        partial void OnNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Guid rowguid
        {
            get
            {
                return _rowguid;
            }
            set
            {
                OnrowguidChanging(value);
                ReportPropertyChanging("rowguid");
                _rowguid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("rowguid");
                OnrowguidChanged();
            }
        }
        private global::System.Guid _rowguid;
        partial void OnrowguidChanging(global::System.Guid value);
        partial void OnrowguidChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_CustomerAddress_AddressType_AddressTypeID", "CustomerAddress")]
        public EntityCollection<CustomerAddress> CustomerAddresses
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<CustomerAddress>("AdventureWorksModel.FK_CustomerAddress_AddressType_AddressTypeID", "CustomerAddress");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<CustomerAddress>("AdventureWorksModel.FK_CustomerAddress_AddressType_AddressTypeID", "CustomerAddress", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_VendorAddress_AddressType_AddressTypeID", "VendorAddress")]
        public EntityCollection<VendorAddress> VendorAddresses
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<VendorAddress>("AdventureWorksModel.FK_VendorAddress_AddressType_AddressTypeID", "VendorAddress");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<VendorAddress>("AdventureWorksModel.FK_VendorAddress_AddressType_AddressTypeID", "VendorAddress", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="AWBuildVersion")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class AWBuildVersion : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new AWBuildVersion object.
        /// </summary>
        /// <param name="systemInformationID">Initial value of the SystemInformationID property.</param>
        /// <param name="database_Version">Initial value of the Database_Version property.</param>
        /// <param name="versionDate">Initial value of the VersionDate property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static AWBuildVersion CreateAWBuildVersion(global::System.Byte systemInformationID, global::System.String database_Version, global::System.DateTime versionDate, global::System.DateTime modifiedDate)
        {
            AWBuildVersion aWBuildVersion = new AWBuildVersion();
            aWBuildVersion.SystemInformationID = systemInformationID;
            aWBuildVersion.Database_Version = database_Version;
            aWBuildVersion.VersionDate = versionDate;
            aWBuildVersion.ModifiedDate = modifiedDate;
            return aWBuildVersion;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Byte SystemInformationID
        {
            get
            {
                return _SystemInformationID;
            }
            set
            {
                if (_SystemInformationID != value)
                {
                    OnSystemInformationIDChanging(value);
                    ReportPropertyChanging("SystemInformationID");
                    _SystemInformationID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("SystemInformationID");
                    OnSystemInformationIDChanged();
                }
            }
        }
        private global::System.Byte _SystemInformationID;
        partial void OnSystemInformationIDChanging(global::System.Byte value);
        partial void OnSystemInformationIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Database_Version
        {
            get
            {
                return _Database_Version;
            }
            set
            {
                OnDatabase_VersionChanging(value);
                ReportPropertyChanging("Database_Version");
                _Database_Version = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Database_Version");
                OnDatabase_VersionChanged();
            }
        }
        private global::System.String _Database_Version;
        partial void OnDatabase_VersionChanging(global::System.String value);
        partial void OnDatabase_VersionChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime VersionDate
        {
            get
            {
                return _VersionDate;
            }
            set
            {
                OnVersionDateChanging(value);
                ReportPropertyChanging("VersionDate");
                _VersionDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("VersionDate");
                OnVersionDateChanged();
            }
        }
        private global::System.DateTime _VersionDate;
        partial void OnVersionDateChanging(global::System.DateTime value);
        partial void OnVersionDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="BillOfMaterial")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class BillOfMaterial : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new BillOfMaterial object.
        /// </summary>
        /// <param name="billOfMaterialsID">Initial value of the BillOfMaterialsID property.</param>
        /// <param name="componentID">Initial value of the ComponentID property.</param>
        /// <param name="startDate">Initial value of the StartDate property.</param>
        /// <param name="unitMeasureCode">Initial value of the UnitMeasureCode property.</param>
        /// <param name="bOMLevel">Initial value of the BOMLevel property.</param>
        /// <param name="perAssemblyQty">Initial value of the PerAssemblyQty property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static BillOfMaterial CreateBillOfMaterial(global::System.Int32 billOfMaterialsID, global::System.Int32 componentID, global::System.DateTime startDate, global::System.String unitMeasureCode, global::System.Int16 bOMLevel, global::System.Decimal perAssemblyQty, global::System.DateTime modifiedDate)
        {
            BillOfMaterial billOfMaterial = new BillOfMaterial();
            billOfMaterial.BillOfMaterialsID = billOfMaterialsID;
            billOfMaterial.ComponentID = componentID;
            billOfMaterial.StartDate = startDate;
            billOfMaterial.UnitMeasureCode = unitMeasureCode;
            billOfMaterial.BOMLevel = bOMLevel;
            billOfMaterial.PerAssemblyQty = perAssemblyQty;
            billOfMaterial.ModifiedDate = modifiedDate;
            return billOfMaterial;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 BillOfMaterialsID
        {
            get
            {
                return _BillOfMaterialsID;
            }
            set
            {
                if (_BillOfMaterialsID != value)
                {
                    OnBillOfMaterialsIDChanging(value);
                    ReportPropertyChanging("BillOfMaterialsID");
                    _BillOfMaterialsID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("BillOfMaterialsID");
                    OnBillOfMaterialsIDChanged();
                }
            }
        }
        private global::System.Int32 _BillOfMaterialsID;
        partial void OnBillOfMaterialsIDChanging(global::System.Int32 value);
        partial void OnBillOfMaterialsIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> ProductAssemblyID
        {
            get
            {
                return _ProductAssemblyID;
            }
            set
            {
                OnProductAssemblyIDChanging(value);
                ReportPropertyChanging("ProductAssemblyID");
                _ProductAssemblyID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ProductAssemblyID");
                OnProductAssemblyIDChanged();
            }
        }
        private Nullable<global::System.Int32> _ProductAssemblyID;
        partial void OnProductAssemblyIDChanging(Nullable<global::System.Int32> value);
        partial void OnProductAssemblyIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ComponentID
        {
            get
            {
                return _ComponentID;
            }
            set
            {
                OnComponentIDChanging(value);
                ReportPropertyChanging("ComponentID");
                _ComponentID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ComponentID");
                OnComponentIDChanged();
            }
        }
        private global::System.Int32 _ComponentID;
        partial void OnComponentIDChanging(global::System.Int32 value);
        partial void OnComponentIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime StartDate
        {
            get
            {
                return _StartDate;
            }
            set
            {
                OnStartDateChanging(value);
                ReportPropertyChanging("StartDate");
                _StartDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("StartDate");
                OnStartDateChanged();
            }
        }
        private global::System.DateTime _StartDate;
        partial void OnStartDateChanging(global::System.DateTime value);
        partial void OnStartDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.DateTime> EndDate
        {
            get
            {
                return _EndDate;
            }
            set
            {
                OnEndDateChanging(value);
                ReportPropertyChanging("EndDate");
                _EndDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("EndDate");
                OnEndDateChanged();
            }
        }
        private Nullable<global::System.DateTime> _EndDate;
        partial void OnEndDateChanging(Nullable<global::System.DateTime> value);
        partial void OnEndDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String UnitMeasureCode
        {
            get
            {
                return _UnitMeasureCode;
            }
            set
            {
                OnUnitMeasureCodeChanging(value);
                ReportPropertyChanging("UnitMeasureCode");
                _UnitMeasureCode = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("UnitMeasureCode");
                OnUnitMeasureCodeChanged();
            }
        }
        private global::System.String _UnitMeasureCode;
        partial void OnUnitMeasureCodeChanging(global::System.String value);
        partial void OnUnitMeasureCodeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int16 BOMLevel
        {
            get
            {
                return _BOMLevel;
            }
            set
            {
                OnBOMLevelChanging(value);
                ReportPropertyChanging("BOMLevel");
                _BOMLevel = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("BOMLevel");
                OnBOMLevelChanged();
            }
        }
        private global::System.Int16 _BOMLevel;
        partial void OnBOMLevelChanging(global::System.Int16 value);
        partial void OnBOMLevelChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal PerAssemblyQty
        {
            get
            {
                return _PerAssemblyQty;
            }
            set
            {
                OnPerAssemblyQtyChanging(value);
                ReportPropertyChanging("PerAssemblyQty");
                _PerAssemblyQty = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("PerAssemblyQty");
                OnPerAssemblyQtyChanged();
            }
        }
        private global::System.Decimal _PerAssemblyQty;
        partial void OnPerAssemblyQtyChanging(global::System.Decimal value);
        partial void OnPerAssemblyQtyChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_BillOfMaterials_Product_ComponentID", "Product")]
        public Product Product
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_BillOfMaterials_Product_ComponentID", "Product").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_BillOfMaterials_Product_ComponentID", "Product").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Product> ProductReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_BillOfMaterials_Product_ComponentID", "Product");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Product>("AdventureWorksModel.FK_BillOfMaterials_Product_ComponentID", "Product", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_BillOfMaterials_Product_ProductAssemblyID", "Product")]
        public Product Product1
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_BillOfMaterials_Product_ProductAssemblyID", "Product").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_BillOfMaterials_Product_ProductAssemblyID", "Product").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Product> Product1Reference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_BillOfMaterials_Product_ProductAssemblyID", "Product");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Product>("AdventureWorksModel.FK_BillOfMaterials_Product_ProductAssemblyID", "Product", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_BillOfMaterials_UnitMeasure_UnitMeasureCode", "UnitMeasure")]
        public UnitMeasure UnitMeasure
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<UnitMeasure>("AdventureWorksModel.FK_BillOfMaterials_UnitMeasure_UnitMeasureCode", "UnitMeasure").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<UnitMeasure>("AdventureWorksModel.FK_BillOfMaterials_UnitMeasure_UnitMeasureCode", "UnitMeasure").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<UnitMeasure> UnitMeasureReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<UnitMeasure>("AdventureWorksModel.FK_BillOfMaterials_UnitMeasure_UnitMeasureCode", "UnitMeasure");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<UnitMeasure>("AdventureWorksModel.FK_BillOfMaterials_UnitMeasure_UnitMeasureCode", "UnitMeasure", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="Contact")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class Contact : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new Contact object.
        /// </summary>
        /// <param name="contactID">Initial value of the ContactID property.</param>
        /// <param name="nameStyle">Initial value of the NameStyle property.</param>
        /// <param name="firstName">Initial value of the FirstName property.</param>
        /// <param name="lastName">Initial value of the LastName property.</param>
        /// <param name="emailPromotion">Initial value of the EmailPromotion property.</param>
        /// <param name="passwordHash">Initial value of the PasswordHash property.</param>
        /// <param name="passwordSalt">Initial value of the PasswordSalt property.</param>
        /// <param name="rowguid">Initial value of the rowguid property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static Contact CreateContact(global::System.Int32 contactID, global::System.Boolean nameStyle, global::System.String firstName, global::System.String lastName, global::System.Int32 emailPromotion, global::System.String passwordHash, global::System.String passwordSalt, global::System.Guid rowguid, global::System.DateTime modifiedDate)
        {
            Contact contact = new Contact();
            contact.ContactID = contactID;
            contact.NameStyle = nameStyle;
            contact.FirstName = firstName;
            contact.LastName = lastName;
            contact.EmailPromotion = emailPromotion;
            contact.PasswordHash = passwordHash;
            contact.PasswordSalt = passwordSalt;
            contact.rowguid = rowguid;
            contact.ModifiedDate = modifiedDate;
            return contact;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ContactID
        {
            get
            {
                return _ContactID;
            }
            set
            {
                if (_ContactID != value)
                {
                    OnContactIDChanging(value);
                    ReportPropertyChanging("ContactID");
                    _ContactID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ContactID");
                    OnContactIDChanged();
                }
            }
        }
        private global::System.Int32 _ContactID;
        partial void OnContactIDChanging(global::System.Int32 value);
        partial void OnContactIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Boolean NameStyle
        {
            get
            {
                return _NameStyle;
            }
            set
            {
                OnNameStyleChanging(value);
                ReportPropertyChanging("NameStyle");
                _NameStyle = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("NameStyle");
                OnNameStyleChanged();
            }
        }
        private global::System.Boolean _NameStyle;
        partial void OnNameStyleChanging(global::System.Boolean value);
        partial void OnNameStyleChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String Title
        {
            get
            {
                return _Title;
            }
            set
            {
                OnTitleChanging(value);
                ReportPropertyChanging("Title");
                _Title = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("Title");
                OnTitleChanged();
            }
        }
        private global::System.String _Title;
        partial void OnTitleChanging(global::System.String value);
        partial void OnTitleChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String FirstName
        {
            get
            {
                return _FirstName;
            }
            set
            {
                OnFirstNameChanging(value);
                ReportPropertyChanging("FirstName");
                _FirstName = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("FirstName");
                OnFirstNameChanged();
            }
        }
        private global::System.String _FirstName;
        partial void OnFirstNameChanging(global::System.String value);
        partial void OnFirstNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String MiddleName
        {
            get
            {
                return _MiddleName;
            }
            set
            {
                OnMiddleNameChanging(value);
                ReportPropertyChanging("MiddleName");
                _MiddleName = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("MiddleName");
                OnMiddleNameChanged();
            }
        }
        private global::System.String _MiddleName;
        partial void OnMiddleNameChanging(global::System.String value);
        partial void OnMiddleNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String LastName
        {
            get
            {
                return _LastName;
            }
            set
            {
                OnLastNameChanging(value);
                ReportPropertyChanging("LastName");
                _LastName = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("LastName");
                OnLastNameChanged();
            }
        }
        private global::System.String _LastName;
        partial void OnLastNameChanging(global::System.String value);
        partial void OnLastNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String Suffix
        {
            get
            {
                return _Suffix;
            }
            set
            {
                OnSuffixChanging(value);
                ReportPropertyChanging("Suffix");
                _Suffix = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("Suffix");
                OnSuffixChanged();
            }
        }
        private global::System.String _Suffix;
        partial void OnSuffixChanging(global::System.String value);
        partial void OnSuffixChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String EmailAddress
        {
            get
            {
                return _EmailAddress;
            }
            set
            {
                OnEmailAddressChanging(value);
                ReportPropertyChanging("EmailAddress");
                _EmailAddress = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("EmailAddress");
                OnEmailAddressChanged();
            }
        }
        private global::System.String _EmailAddress;
        partial void OnEmailAddressChanging(global::System.String value);
        partial void OnEmailAddressChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 EmailPromotion
        {
            get
            {
                return _EmailPromotion;
            }
            set
            {
                OnEmailPromotionChanging(value);
                ReportPropertyChanging("EmailPromotion");
                _EmailPromotion = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("EmailPromotion");
                OnEmailPromotionChanged();
            }
        }
        private global::System.Int32 _EmailPromotion;
        partial void OnEmailPromotionChanging(global::System.Int32 value);
        partial void OnEmailPromotionChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String Phone
        {
            get
            {
                return _Phone;
            }
            set
            {
                OnPhoneChanging(value);
                ReportPropertyChanging("Phone");
                _Phone = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("Phone");
                OnPhoneChanged();
            }
        }
        private global::System.String _Phone;
        partial void OnPhoneChanging(global::System.String value);
        partial void OnPhoneChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String PasswordHash
        {
            get
            {
                return _PasswordHash;
            }
            set
            {
                OnPasswordHashChanging(value);
                ReportPropertyChanging("PasswordHash");
                _PasswordHash = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("PasswordHash");
                OnPasswordHashChanged();
            }
        }
        private global::System.String _PasswordHash;
        partial void OnPasswordHashChanging(global::System.String value);
        partial void OnPasswordHashChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String PasswordSalt
        {
            get
            {
                return _PasswordSalt;
            }
            set
            {
                OnPasswordSaltChanging(value);
                ReportPropertyChanging("PasswordSalt");
                _PasswordSalt = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("PasswordSalt");
                OnPasswordSaltChanged();
            }
        }
        private global::System.String _PasswordSalt;
        partial void OnPasswordSaltChanging(global::System.String value);
        partial void OnPasswordSaltChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String AdditionalContactInfo
        {
            get
            {
                return _AdditionalContactInfo;
            }
            set
            {
                OnAdditionalContactInfoChanging(value);
                ReportPropertyChanging("AdditionalContactInfo");
                _AdditionalContactInfo = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("AdditionalContactInfo");
                OnAdditionalContactInfoChanged();
            }
        }
        private global::System.String _AdditionalContactInfo;
        partial void OnAdditionalContactInfoChanging(global::System.String value);
        partial void OnAdditionalContactInfoChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Guid rowguid
        {
            get
            {
                return _rowguid;
            }
            set
            {
                OnrowguidChanging(value);
                ReportPropertyChanging("rowguid");
                _rowguid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("rowguid");
                OnrowguidChanged();
            }
        }
        private global::System.Guid _rowguid;
        partial void OnrowguidChanging(global::System.Guid value);
        partial void OnrowguidChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_Employee_Contact_ContactID", "Employee")]
        public EntityCollection<Employee> Employees
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<Employee>("AdventureWorksModel.FK_Employee_Contact_ContactID", "Employee");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<Employee>("AdventureWorksModel.FK_Employee_Contact_ContactID", "Employee", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ContactCreditCard_Contact_ContactID", "ContactCreditCard")]
        public EntityCollection<ContactCreditCard> ContactCreditCards
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<ContactCreditCard>("AdventureWorksModel.FK_ContactCreditCard_Contact_ContactID", "ContactCreditCard");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<ContactCreditCard>("AdventureWorksModel.FK_ContactCreditCard_Contact_ContactID", "ContactCreditCard", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_Individual_Contact_ContactID", "Individual")]
        public EntityCollection<Individual> Individuals
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<Individual>("AdventureWorksModel.FK_Individual_Contact_ContactID", "Individual");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<Individual>("AdventureWorksModel.FK_Individual_Contact_ContactID", "Individual", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Contact_ContactID", "SalesOrderHeader")]
        public EntityCollection<SalesOrderHeader> SalesOrderHeaders
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<SalesOrderHeader>("AdventureWorksModel.FK_SalesOrderHeader_Contact_ContactID", "SalesOrderHeader");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<SalesOrderHeader>("AdventureWorksModel.FK_SalesOrderHeader_Contact_ContactID", "SalesOrderHeader", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_StoreContact_Contact_ContactID", "StoreContact")]
        public EntityCollection<StoreContact> StoreContacts
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<StoreContact>("AdventureWorksModel.FK_StoreContact_Contact_ContactID", "StoreContact");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<StoreContact>("AdventureWorksModel.FK_StoreContact_Contact_ContactID", "StoreContact", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_VendorContact_Contact_ContactID", "VendorContact")]
        public EntityCollection<VendorContact> VendorContacts
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<VendorContact>("AdventureWorksModel.FK_VendorContact_Contact_ContactID", "VendorContact");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<VendorContact>("AdventureWorksModel.FK_VendorContact_Contact_ContactID", "VendorContact", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="ContactCreditCard")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class ContactCreditCard : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new ContactCreditCard object.
        /// </summary>
        /// <param name="contactID">Initial value of the ContactID property.</param>
        /// <param name="creditCardID">Initial value of the CreditCardID property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static ContactCreditCard CreateContactCreditCard(global::System.Int32 contactID, global::System.Int32 creditCardID, global::System.DateTime modifiedDate)
        {
            ContactCreditCard contactCreditCard = new ContactCreditCard();
            contactCreditCard.ContactID = contactID;
            contactCreditCard.CreditCardID = creditCardID;
            contactCreditCard.ModifiedDate = modifiedDate;
            return contactCreditCard;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ContactID
        {
            get
            {
                return _ContactID;
            }
            set
            {
                if (_ContactID != value)
                {
                    OnContactIDChanging(value);
                    ReportPropertyChanging("ContactID");
                    _ContactID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ContactID");
                    OnContactIDChanged();
                }
            }
        }
        private global::System.Int32 _ContactID;
        partial void OnContactIDChanging(global::System.Int32 value);
        partial void OnContactIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 CreditCardID
        {
            get
            {
                return _CreditCardID;
            }
            set
            {
                if (_CreditCardID != value)
                {
                    OnCreditCardIDChanging(value);
                    ReportPropertyChanging("CreditCardID");
                    _CreditCardID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("CreditCardID");
                    OnCreditCardIDChanged();
                }
            }
        }
        private global::System.Int32 _CreditCardID;
        partial void OnCreditCardIDChanging(global::System.Int32 value);
        partial void OnCreditCardIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ContactCreditCard_Contact_ContactID", "Contact")]
        public Contact Contact
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Contact>("AdventureWorksModel.FK_ContactCreditCard_Contact_ContactID", "Contact").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Contact>("AdventureWorksModel.FK_ContactCreditCard_Contact_ContactID", "Contact").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Contact> ContactReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Contact>("AdventureWorksModel.FK_ContactCreditCard_Contact_ContactID", "Contact");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Contact>("AdventureWorksModel.FK_ContactCreditCard_Contact_ContactID", "Contact", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ContactCreditCard_CreditCard_CreditCardID", "CreditCard")]
        public CreditCard CreditCard
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<CreditCard>("AdventureWorksModel.FK_ContactCreditCard_CreditCard_CreditCardID", "CreditCard").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<CreditCard>("AdventureWorksModel.FK_ContactCreditCard_CreditCard_CreditCardID", "CreditCard").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<CreditCard> CreditCardReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<CreditCard>("AdventureWorksModel.FK_ContactCreditCard_CreditCard_CreditCardID", "CreditCard");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<CreditCard>("AdventureWorksModel.FK_ContactCreditCard_CreditCard_CreditCardID", "CreditCard", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="ContactType")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class ContactType : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new ContactType object.
        /// </summary>
        /// <param name="contactTypeID">Initial value of the ContactTypeID property.</param>
        /// <param name="name">Initial value of the Name property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static ContactType CreateContactType(global::System.Int32 contactTypeID, global::System.String name, global::System.DateTime modifiedDate)
        {
            ContactType contactType = new ContactType();
            contactType.ContactTypeID = contactTypeID;
            contactType.Name = name;
            contactType.ModifiedDate = modifiedDate;
            return contactType;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ContactTypeID
        {
            get
            {
                return _ContactTypeID;
            }
            set
            {
                if (_ContactTypeID != value)
                {
                    OnContactTypeIDChanging(value);
                    ReportPropertyChanging("ContactTypeID");
                    _ContactTypeID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ContactTypeID");
                    OnContactTypeIDChanged();
                }
            }
        }
        private global::System.Int32 _ContactTypeID;
        partial void OnContactTypeIDChanging(global::System.Int32 value);
        partial void OnContactTypeIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Name
        {
            get
            {
                return _Name;
            }
            set
            {
                OnNameChanging(value);
                ReportPropertyChanging("Name");
                _Name = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Name");
                OnNameChanged();
            }
        }
        private global::System.String _Name;
        partial void OnNameChanging(global::System.String value);
        partial void OnNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_StoreContact_ContactType_ContactTypeID", "StoreContact")]
        public EntityCollection<StoreContact> StoreContacts
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<StoreContact>("AdventureWorksModel.FK_StoreContact_ContactType_ContactTypeID", "StoreContact");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<StoreContact>("AdventureWorksModel.FK_StoreContact_ContactType_ContactTypeID", "StoreContact", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_VendorContact_ContactType_ContactTypeID", "VendorContact")]
        public EntityCollection<VendorContact> VendorContacts
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<VendorContact>("AdventureWorksModel.FK_VendorContact_ContactType_ContactTypeID", "VendorContact");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<VendorContact>("AdventureWorksModel.FK_VendorContact_ContactType_ContactTypeID", "VendorContact", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="CountryRegion")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class CountryRegion : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new CountryRegion object.
        /// </summary>
        /// <param name="countryRegionCode">Initial value of the CountryRegionCode property.</param>
        /// <param name="name">Initial value of the Name property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static CountryRegion CreateCountryRegion(global::System.String countryRegionCode, global::System.String name, global::System.DateTime modifiedDate)
        {
            CountryRegion countryRegion = new CountryRegion();
            countryRegion.CountryRegionCode = countryRegionCode;
            countryRegion.Name = name;
            countryRegion.ModifiedDate = modifiedDate;
            return countryRegion;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String CountryRegionCode
        {
            get
            {
                return _CountryRegionCode;
            }
            set
            {
                if (_CountryRegionCode != value)
                {
                    OnCountryRegionCodeChanging(value);
                    ReportPropertyChanging("CountryRegionCode");
                    _CountryRegionCode = StructuralObject.SetValidValue(value, false);
                    ReportPropertyChanged("CountryRegionCode");
                    OnCountryRegionCodeChanged();
                }
            }
        }
        private global::System.String _CountryRegionCode;
        partial void OnCountryRegionCodeChanging(global::System.String value);
        partial void OnCountryRegionCodeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Name
        {
            get
            {
                return _Name;
            }
            set
            {
                OnNameChanging(value);
                ReportPropertyChanging("Name");
                _Name = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Name");
                OnNameChanged();
            }
        }
        private global::System.String _Name;
        partial void OnNameChanging(global::System.String value);
        partial void OnNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_CountryRegionCurrency_CountryRegion_CountryRegionCode", "CountryRegionCurrency")]
        public EntityCollection<CountryRegionCurrency> CountryRegionCurrencies
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<CountryRegionCurrency>("AdventureWorksModel.FK_CountryRegionCurrency_CountryRegion_CountryRegionCode", "CountryRegionCurrency");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<CountryRegionCurrency>("AdventureWorksModel.FK_CountryRegionCurrency_CountryRegion_CountryRegionCode", "CountryRegionCurrency", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_StateProvince_CountryRegion_CountryRegionCode", "StateProvince")]
        public EntityCollection<StateProvince> StateProvinces
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<StateProvince>("AdventureWorksModel.FK_StateProvince_CountryRegion_CountryRegionCode", "StateProvince");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<StateProvince>("AdventureWorksModel.FK_StateProvince_CountryRegion_CountryRegionCode", "StateProvince", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="CountryRegionCurrency")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class CountryRegionCurrency : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new CountryRegionCurrency object.
        /// </summary>
        /// <param name="countryRegionCode">Initial value of the CountryRegionCode property.</param>
        /// <param name="currencyCode">Initial value of the CurrencyCode property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static CountryRegionCurrency CreateCountryRegionCurrency(global::System.String countryRegionCode, global::System.String currencyCode, global::System.DateTime modifiedDate)
        {
            CountryRegionCurrency countryRegionCurrency = new CountryRegionCurrency();
            countryRegionCurrency.CountryRegionCode = countryRegionCode;
            countryRegionCurrency.CurrencyCode = currencyCode;
            countryRegionCurrency.ModifiedDate = modifiedDate;
            return countryRegionCurrency;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String CountryRegionCode
        {
            get
            {
                return _CountryRegionCode;
            }
            set
            {
                if (_CountryRegionCode != value)
                {
                    OnCountryRegionCodeChanging(value);
                    ReportPropertyChanging("CountryRegionCode");
                    _CountryRegionCode = StructuralObject.SetValidValue(value, false);
                    ReportPropertyChanged("CountryRegionCode");
                    OnCountryRegionCodeChanged();
                }
            }
        }
        private global::System.String _CountryRegionCode;
        partial void OnCountryRegionCodeChanging(global::System.String value);
        partial void OnCountryRegionCodeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String CurrencyCode
        {
            get
            {
                return _CurrencyCode;
            }
            set
            {
                if (_CurrencyCode != value)
                {
                    OnCurrencyCodeChanging(value);
                    ReportPropertyChanging("CurrencyCode");
                    _CurrencyCode = StructuralObject.SetValidValue(value, false);
                    ReportPropertyChanged("CurrencyCode");
                    OnCurrencyCodeChanged();
                }
            }
        }
        private global::System.String _CurrencyCode;
        partial void OnCurrencyCodeChanging(global::System.String value);
        partial void OnCurrencyCodeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_CountryRegionCurrency_CountryRegion_CountryRegionCode", "CountryRegion")]
        public CountryRegion CountryRegion
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<CountryRegion>("AdventureWorksModel.FK_CountryRegionCurrency_CountryRegion_CountryRegionCode", "CountryRegion").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<CountryRegion>("AdventureWorksModel.FK_CountryRegionCurrency_CountryRegion_CountryRegionCode", "CountryRegion").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<CountryRegion> CountryRegionReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<CountryRegion>("AdventureWorksModel.FK_CountryRegionCurrency_CountryRegion_CountryRegionCode", "CountryRegion");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<CountryRegion>("AdventureWorksModel.FK_CountryRegionCurrency_CountryRegion_CountryRegionCode", "CountryRegion", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_CountryRegionCurrency_Currency_CurrencyCode", "Currency")]
        public Currency Currency
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Currency>("AdventureWorksModel.FK_CountryRegionCurrency_Currency_CurrencyCode", "Currency").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Currency>("AdventureWorksModel.FK_CountryRegionCurrency_Currency_CurrencyCode", "Currency").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Currency> CurrencyReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Currency>("AdventureWorksModel.FK_CountryRegionCurrency_Currency_CurrencyCode", "Currency");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Currency>("AdventureWorksModel.FK_CountryRegionCurrency_Currency_CurrencyCode", "Currency", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="CreditCard")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class CreditCard : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new CreditCard object.
        /// </summary>
        /// <param name="creditCardID">Initial value of the CreditCardID property.</param>
        /// <param name="cardType">Initial value of the CardType property.</param>
        /// <param name="cardNumber">Initial value of the CardNumber property.</param>
        /// <param name="expMonth">Initial value of the ExpMonth property.</param>
        /// <param name="expYear">Initial value of the ExpYear property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static CreditCard CreateCreditCard(global::System.Int32 creditCardID, global::System.String cardType, global::System.String cardNumber, global::System.Byte expMonth, global::System.Int16 expYear, global::System.DateTime modifiedDate)
        {
            CreditCard creditCard = new CreditCard();
            creditCard.CreditCardID = creditCardID;
            creditCard.CardType = cardType;
            creditCard.CardNumber = cardNumber;
            creditCard.ExpMonth = expMonth;
            creditCard.ExpYear = expYear;
            creditCard.ModifiedDate = modifiedDate;
            return creditCard;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 CreditCardID
        {
            get
            {
                return _CreditCardID;
            }
            set
            {
                if (_CreditCardID != value)
                {
                    OnCreditCardIDChanging(value);
                    ReportPropertyChanging("CreditCardID");
                    _CreditCardID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("CreditCardID");
                    OnCreditCardIDChanged();
                }
            }
        }
        private global::System.Int32 _CreditCardID;
        partial void OnCreditCardIDChanging(global::System.Int32 value);
        partial void OnCreditCardIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String CardType
        {
            get
            {
                return _CardType;
            }
            set
            {
                OnCardTypeChanging(value);
                ReportPropertyChanging("CardType");
                _CardType = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("CardType");
                OnCardTypeChanged();
            }
        }
        private global::System.String _CardType;
        partial void OnCardTypeChanging(global::System.String value);
        partial void OnCardTypeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String CardNumber
        {
            get
            {
                return _CardNumber;
            }
            set
            {
                OnCardNumberChanging(value);
                ReportPropertyChanging("CardNumber");
                _CardNumber = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("CardNumber");
                OnCardNumberChanged();
            }
        }
        private global::System.String _CardNumber;
        partial void OnCardNumberChanging(global::System.String value);
        partial void OnCardNumberChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Byte ExpMonth
        {
            get
            {
                return _ExpMonth;
            }
            set
            {
                OnExpMonthChanging(value);
                ReportPropertyChanging("ExpMonth");
                _ExpMonth = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ExpMonth");
                OnExpMonthChanged();
            }
        }
        private global::System.Byte _ExpMonth;
        partial void OnExpMonthChanging(global::System.Byte value);
        partial void OnExpMonthChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int16 ExpYear
        {
            get
            {
                return _ExpYear;
            }
            set
            {
                OnExpYearChanging(value);
                ReportPropertyChanging("ExpYear");
                _ExpYear = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ExpYear");
                OnExpYearChanged();
            }
        }
        private global::System.Int16 _ExpYear;
        partial void OnExpYearChanging(global::System.Int16 value);
        partial void OnExpYearChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ContactCreditCard_CreditCard_CreditCardID", "ContactCreditCard")]
        public EntityCollection<ContactCreditCard> ContactCreditCards
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<ContactCreditCard>("AdventureWorksModel.FK_ContactCreditCard_CreditCard_CreditCardID", "ContactCreditCard");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<ContactCreditCard>("AdventureWorksModel.FK_ContactCreditCard_CreditCard_CreditCardID", "ContactCreditCard", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_CreditCard_CreditCardID", "SalesOrderHeader")]
        public EntityCollection<SalesOrderHeader> SalesOrderHeaders
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<SalesOrderHeader>("AdventureWorksModel.FK_SalesOrderHeader_CreditCard_CreditCardID", "SalesOrderHeader");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<SalesOrderHeader>("AdventureWorksModel.FK_SalesOrderHeader_CreditCard_CreditCardID", "SalesOrderHeader", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="Culture")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class Culture : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new Culture object.
        /// </summary>
        /// <param name="cultureID">Initial value of the CultureID property.</param>
        /// <param name="name">Initial value of the Name property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static Culture CreateCulture(global::System.String cultureID, global::System.String name, global::System.DateTime modifiedDate)
        {
            Culture culture = new Culture();
            culture.CultureID = cultureID;
            culture.Name = name;
            culture.ModifiedDate = modifiedDate;
            return culture;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String CultureID
        {
            get
            {
                return _CultureID;
            }
            set
            {
                if (_CultureID != value)
                {
                    OnCultureIDChanging(value);
                    ReportPropertyChanging("CultureID");
                    _CultureID = StructuralObject.SetValidValue(value, false);
                    ReportPropertyChanged("CultureID");
                    OnCultureIDChanged();
                }
            }
        }
        private global::System.String _CultureID;
        partial void OnCultureIDChanging(global::System.String value);
        partial void OnCultureIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Name
        {
            get
            {
                return _Name;
            }
            set
            {
                OnNameChanging(value);
                ReportPropertyChanging("Name");
                _Name = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Name");
                OnNameChanged();
            }
        }
        private global::System.String _Name;
        partial void OnNameChanging(global::System.String value);
        partial void OnNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductModelProductDescriptionCulture_Culture_CultureID", "ProductModelProductDescriptionCulture")]
        public EntityCollection<ProductModelProductDescriptionCulture> ProductModelProductDescriptionCultures
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<ProductModelProductDescriptionCulture>("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_Culture_CultureID", "ProductModelProductDescriptionCulture");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<ProductModelProductDescriptionCulture>("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_Culture_CultureID", "ProductModelProductDescriptionCulture", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="Currency")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class Currency : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new Currency object.
        /// </summary>
        /// <param name="currencyCode">Initial value of the CurrencyCode property.</param>
        /// <param name="name">Initial value of the Name property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static Currency CreateCurrency(global::System.String currencyCode, global::System.String name, global::System.DateTime modifiedDate)
        {
            Currency currency = new Currency();
            currency.CurrencyCode = currencyCode;
            currency.Name = name;
            currency.ModifiedDate = modifiedDate;
            return currency;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String CurrencyCode
        {
            get
            {
                return _CurrencyCode;
            }
            set
            {
                if (_CurrencyCode != value)
                {
                    OnCurrencyCodeChanging(value);
                    ReportPropertyChanging("CurrencyCode");
                    _CurrencyCode = StructuralObject.SetValidValue(value, false);
                    ReportPropertyChanged("CurrencyCode");
                    OnCurrencyCodeChanged();
                }
            }
        }
        private global::System.String _CurrencyCode;
        partial void OnCurrencyCodeChanging(global::System.String value);
        partial void OnCurrencyCodeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Name
        {
            get
            {
                return _Name;
            }
            set
            {
                OnNameChanging(value);
                ReportPropertyChanging("Name");
                _Name = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Name");
                OnNameChanged();
            }
        }
        private global::System.String _Name;
        partial void OnNameChanging(global::System.String value);
        partial void OnNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_CountryRegionCurrency_Currency_CurrencyCode", "CountryRegionCurrency")]
        public EntityCollection<CountryRegionCurrency> CountryRegionCurrencies
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<CountryRegionCurrency>("AdventureWorksModel.FK_CountryRegionCurrency_Currency_CurrencyCode", "CountryRegionCurrency");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<CountryRegionCurrency>("AdventureWorksModel.FK_CountryRegionCurrency_Currency_CurrencyCode", "CountryRegionCurrency", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_CurrencyRate_Currency_FromCurrencyCode", "CurrencyRate")]
        public EntityCollection<CurrencyRate> CurrencyRates
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<CurrencyRate>("AdventureWorksModel.FK_CurrencyRate_Currency_FromCurrencyCode", "CurrencyRate");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<CurrencyRate>("AdventureWorksModel.FK_CurrencyRate_Currency_FromCurrencyCode", "CurrencyRate", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_CurrencyRate_Currency_ToCurrencyCode", "CurrencyRate")]
        public EntityCollection<CurrencyRate> CurrencyRates1
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<CurrencyRate>("AdventureWorksModel.FK_CurrencyRate_Currency_ToCurrencyCode", "CurrencyRate");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<CurrencyRate>("AdventureWorksModel.FK_CurrencyRate_Currency_ToCurrencyCode", "CurrencyRate", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="CurrencyRate")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class CurrencyRate : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new CurrencyRate object.
        /// </summary>
        /// <param name="currencyRateID">Initial value of the CurrencyRateID property.</param>
        /// <param name="currencyRateDate">Initial value of the CurrencyRateDate property.</param>
        /// <param name="fromCurrencyCode">Initial value of the FromCurrencyCode property.</param>
        /// <param name="toCurrencyCode">Initial value of the ToCurrencyCode property.</param>
        /// <param name="averageRate">Initial value of the AverageRate property.</param>
        /// <param name="endOfDayRate">Initial value of the EndOfDayRate property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static CurrencyRate CreateCurrencyRate(global::System.Int32 currencyRateID, global::System.DateTime currencyRateDate, global::System.String fromCurrencyCode, global::System.String toCurrencyCode, global::System.Decimal averageRate, global::System.Decimal endOfDayRate, global::System.DateTime modifiedDate)
        {
            CurrencyRate currencyRate = new CurrencyRate();
            currencyRate.CurrencyRateID = currencyRateID;
            currencyRate.CurrencyRateDate = currencyRateDate;
            currencyRate.FromCurrencyCode = fromCurrencyCode;
            currencyRate.ToCurrencyCode = toCurrencyCode;
            currencyRate.AverageRate = averageRate;
            currencyRate.EndOfDayRate = endOfDayRate;
            currencyRate.ModifiedDate = modifiedDate;
            return currencyRate;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 CurrencyRateID
        {
            get
            {
                return _CurrencyRateID;
            }
            set
            {
                if (_CurrencyRateID != value)
                {
                    OnCurrencyRateIDChanging(value);
                    ReportPropertyChanging("CurrencyRateID");
                    _CurrencyRateID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("CurrencyRateID");
                    OnCurrencyRateIDChanged();
                }
            }
        }
        private global::System.Int32 _CurrencyRateID;
        partial void OnCurrencyRateIDChanging(global::System.Int32 value);
        partial void OnCurrencyRateIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime CurrencyRateDate
        {
            get
            {
                return _CurrencyRateDate;
            }
            set
            {
                OnCurrencyRateDateChanging(value);
                ReportPropertyChanging("CurrencyRateDate");
                _CurrencyRateDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("CurrencyRateDate");
                OnCurrencyRateDateChanged();
            }
        }
        private global::System.DateTime _CurrencyRateDate;
        partial void OnCurrencyRateDateChanging(global::System.DateTime value);
        partial void OnCurrencyRateDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String FromCurrencyCode
        {
            get
            {
                return _FromCurrencyCode;
            }
            set
            {
                OnFromCurrencyCodeChanging(value);
                ReportPropertyChanging("FromCurrencyCode");
                _FromCurrencyCode = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("FromCurrencyCode");
                OnFromCurrencyCodeChanged();
            }
        }
        private global::System.String _FromCurrencyCode;
        partial void OnFromCurrencyCodeChanging(global::System.String value);
        partial void OnFromCurrencyCodeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String ToCurrencyCode
        {
            get
            {
                return _ToCurrencyCode;
            }
            set
            {
                OnToCurrencyCodeChanging(value);
                ReportPropertyChanging("ToCurrencyCode");
                _ToCurrencyCode = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("ToCurrencyCode");
                OnToCurrencyCodeChanged();
            }
        }
        private global::System.String _ToCurrencyCode;
        partial void OnToCurrencyCodeChanging(global::System.String value);
        partial void OnToCurrencyCodeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal AverageRate
        {
            get
            {
                return _AverageRate;
            }
            set
            {
                OnAverageRateChanging(value);
                ReportPropertyChanging("AverageRate");
                _AverageRate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("AverageRate");
                OnAverageRateChanged();
            }
        }
        private global::System.Decimal _AverageRate;
        partial void OnAverageRateChanging(global::System.Decimal value);
        partial void OnAverageRateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal EndOfDayRate
        {
            get
            {
                return _EndOfDayRate;
            }
            set
            {
                OnEndOfDayRateChanging(value);
                ReportPropertyChanging("EndOfDayRate");
                _EndOfDayRate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("EndOfDayRate");
                OnEndOfDayRateChanged();
            }
        }
        private global::System.Decimal _EndOfDayRate;
        partial void OnEndOfDayRateChanging(global::System.Decimal value);
        partial void OnEndOfDayRateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_CurrencyRate_Currency_FromCurrencyCode", "Currency")]
        public Currency Currency
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Currency>("AdventureWorksModel.FK_CurrencyRate_Currency_FromCurrencyCode", "Currency").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Currency>("AdventureWorksModel.FK_CurrencyRate_Currency_FromCurrencyCode", "Currency").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Currency> CurrencyReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Currency>("AdventureWorksModel.FK_CurrencyRate_Currency_FromCurrencyCode", "Currency");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Currency>("AdventureWorksModel.FK_CurrencyRate_Currency_FromCurrencyCode", "Currency", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_CurrencyRate_Currency_ToCurrencyCode", "Currency")]
        public Currency Currency1
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Currency>("AdventureWorksModel.FK_CurrencyRate_Currency_ToCurrencyCode", "Currency").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Currency>("AdventureWorksModel.FK_CurrencyRate_Currency_ToCurrencyCode", "Currency").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Currency> Currency1Reference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Currency>("AdventureWorksModel.FK_CurrencyRate_Currency_ToCurrencyCode", "Currency");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Currency>("AdventureWorksModel.FK_CurrencyRate_Currency_ToCurrencyCode", "Currency", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_CurrencyRate_CurrencyRateID", "SalesOrderHeader")]
        public EntityCollection<SalesOrderHeader> SalesOrderHeaders
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<SalesOrderHeader>("AdventureWorksModel.FK_SalesOrderHeader_CurrencyRate_CurrencyRateID", "SalesOrderHeader");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<SalesOrderHeader>("AdventureWorksModel.FK_SalesOrderHeader_CurrencyRate_CurrencyRateID", "SalesOrderHeader", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="Customer")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class Customer : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new Customer object.
        /// </summary>
        /// <param name="customerID">Initial value of the CustomerID property.</param>
        /// <param name="accountNumber">Initial value of the AccountNumber property.</param>
        /// <param name="customerType">Initial value of the CustomerType property.</param>
        /// <param name="rowguid">Initial value of the rowguid property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static Customer CreateCustomer(global::System.Int32 customerID, global::System.String accountNumber, global::System.String customerType, global::System.Guid rowguid, global::System.DateTime modifiedDate)
        {
            Customer customer = new Customer();
            customer.CustomerID = customerID;
            customer.AccountNumber = accountNumber;
            customer.CustomerType = customerType;
            customer.rowguid = rowguid;
            customer.ModifiedDate = modifiedDate;
            return customer;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 CustomerID
        {
            get
            {
                return _CustomerID;
            }
            set
            {
                if (_CustomerID != value)
                {
                    OnCustomerIDChanging(value);
                    ReportPropertyChanging("CustomerID");
                    _CustomerID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("CustomerID");
                    OnCustomerIDChanged();
                }
            }
        }
        private global::System.Int32 _CustomerID;
        partial void OnCustomerIDChanging(global::System.Int32 value);
        partial void OnCustomerIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> TerritoryID
        {
            get
            {
                return _TerritoryID;
            }
            set
            {
                OnTerritoryIDChanging(value);
                ReportPropertyChanging("TerritoryID");
                _TerritoryID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("TerritoryID");
                OnTerritoryIDChanged();
            }
        }
        private Nullable<global::System.Int32> _TerritoryID;
        partial void OnTerritoryIDChanging(Nullable<global::System.Int32> value);
        partial void OnTerritoryIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String AccountNumber
        {
            get
            {
                return _AccountNumber;
            }
            set
            {
                OnAccountNumberChanging(value);
                ReportPropertyChanging("AccountNumber");
                _AccountNumber = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("AccountNumber");
                OnAccountNumberChanged();
            }
        }
        private global::System.String _AccountNumber;
        partial void OnAccountNumberChanging(global::System.String value);
        partial void OnAccountNumberChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String CustomerType
        {
            get
            {
                return _CustomerType;
            }
            set
            {
                OnCustomerTypeChanging(value);
                ReportPropertyChanging("CustomerType");
                _CustomerType = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("CustomerType");
                OnCustomerTypeChanged();
            }
        }
        private global::System.String _CustomerType;
        partial void OnCustomerTypeChanging(global::System.String value);
        partial void OnCustomerTypeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Guid rowguid
        {
            get
            {
                return _rowguid;
            }
            set
            {
                OnrowguidChanging(value);
                ReportPropertyChanging("rowguid");
                _rowguid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("rowguid");
                OnrowguidChanged();
            }
        }
        private global::System.Guid _rowguid;
        partial void OnrowguidChanging(global::System.Guid value);
        partial void OnrowguidChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_Customer_SalesTerritory_TerritoryID", "SalesTerritory")]
        public SalesTerritory SalesTerritory
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesTerritory>("AdventureWorksModel.FK_Customer_SalesTerritory_TerritoryID", "SalesTerritory").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesTerritory>("AdventureWorksModel.FK_Customer_SalesTerritory_TerritoryID", "SalesTerritory").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<SalesTerritory> SalesTerritoryReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesTerritory>("AdventureWorksModel.FK_Customer_SalesTerritory_TerritoryID", "SalesTerritory");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<SalesTerritory>("AdventureWorksModel.FK_Customer_SalesTerritory_TerritoryID", "SalesTerritory", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_CustomerAddress_Customer_CustomerID", "CustomerAddress")]
        public EntityCollection<CustomerAddress> CustomerAddresses
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<CustomerAddress>("AdventureWorksModel.FK_CustomerAddress_Customer_CustomerID", "CustomerAddress");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<CustomerAddress>("AdventureWorksModel.FK_CustomerAddress_Customer_CustomerID", "CustomerAddress", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_Individual_Customer_CustomerID", "Individual")]
        public Individual Individual
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Individual>("AdventureWorksModel.FK_Individual_Customer_CustomerID", "Individual").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Individual>("AdventureWorksModel.FK_Individual_Customer_CustomerID", "Individual").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Individual> IndividualReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Individual>("AdventureWorksModel.FK_Individual_Customer_CustomerID", "Individual");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Individual>("AdventureWorksModel.FK_Individual_Customer_CustomerID", "Individual", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Customer_CustomerID", "SalesOrderHeader")]
        public EntityCollection<SalesOrderHeader> SalesOrderHeaders
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<SalesOrderHeader>("AdventureWorksModel.FK_SalesOrderHeader_Customer_CustomerID", "SalesOrderHeader");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<SalesOrderHeader>("AdventureWorksModel.FK_SalesOrderHeader_Customer_CustomerID", "SalesOrderHeader", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_Store_Customer_CustomerID", "Store")]
        public Store Store
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Store>("AdventureWorksModel.FK_Store_Customer_CustomerID", "Store").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Store>("AdventureWorksModel.FK_Store_Customer_CustomerID", "Store").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Store> StoreReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Store>("AdventureWorksModel.FK_Store_Customer_CustomerID", "Store");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Store>("AdventureWorksModel.FK_Store_Customer_CustomerID", "Store", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="CustomerAddress")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class CustomerAddress : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new CustomerAddress object.
        /// </summary>
        /// <param name="customerID">Initial value of the CustomerID property.</param>
        /// <param name="addressID">Initial value of the AddressID property.</param>
        /// <param name="addressTypeID">Initial value of the AddressTypeID property.</param>
        /// <param name="rowguid">Initial value of the rowguid property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static CustomerAddress CreateCustomerAddress(global::System.Int32 customerID, global::System.Int32 addressID, global::System.Int32 addressTypeID, global::System.Guid rowguid, global::System.DateTime modifiedDate)
        {
            CustomerAddress customerAddress = new CustomerAddress();
            customerAddress.CustomerID = customerID;
            customerAddress.AddressID = addressID;
            customerAddress.AddressTypeID = addressTypeID;
            customerAddress.rowguid = rowguid;
            customerAddress.ModifiedDate = modifiedDate;
            return customerAddress;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 CustomerID
        {
            get
            {
                return _CustomerID;
            }
            set
            {
                if (_CustomerID != value)
                {
                    OnCustomerIDChanging(value);
                    ReportPropertyChanging("CustomerID");
                    _CustomerID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("CustomerID");
                    OnCustomerIDChanged();
                }
            }
        }
        private global::System.Int32 _CustomerID;
        partial void OnCustomerIDChanging(global::System.Int32 value);
        partial void OnCustomerIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 AddressID
        {
            get
            {
                return _AddressID;
            }
            set
            {
                if (_AddressID != value)
                {
                    OnAddressIDChanging(value);
                    ReportPropertyChanging("AddressID");
                    _AddressID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("AddressID");
                    OnAddressIDChanged();
                }
            }
        }
        private global::System.Int32 _AddressID;
        partial void OnAddressIDChanging(global::System.Int32 value);
        partial void OnAddressIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 AddressTypeID
        {
            get
            {
                return _AddressTypeID;
            }
            set
            {
                OnAddressTypeIDChanging(value);
                ReportPropertyChanging("AddressTypeID");
                _AddressTypeID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("AddressTypeID");
                OnAddressTypeIDChanged();
            }
        }
        private global::System.Int32 _AddressTypeID;
        partial void OnAddressTypeIDChanging(global::System.Int32 value);
        partial void OnAddressTypeIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Guid rowguid
        {
            get
            {
                return _rowguid;
            }
            set
            {
                OnrowguidChanging(value);
                ReportPropertyChanging("rowguid");
                _rowguid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("rowguid");
                OnrowguidChanged();
            }
        }
        private global::System.Guid _rowguid;
        partial void OnrowguidChanging(global::System.Guid value);
        partial void OnrowguidChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_CustomerAddress_Address_AddressID", "Address")]
        public Address Address
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Address>("AdventureWorksModel.FK_CustomerAddress_Address_AddressID", "Address").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Address>("AdventureWorksModel.FK_CustomerAddress_Address_AddressID", "Address").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Address> AddressReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Address>("AdventureWorksModel.FK_CustomerAddress_Address_AddressID", "Address");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Address>("AdventureWorksModel.FK_CustomerAddress_Address_AddressID", "Address", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_CustomerAddress_AddressType_AddressTypeID", "AddressType")]
        public AddressType AddressType
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<AddressType>("AdventureWorksModel.FK_CustomerAddress_AddressType_AddressTypeID", "AddressType").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<AddressType>("AdventureWorksModel.FK_CustomerAddress_AddressType_AddressTypeID", "AddressType").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<AddressType> AddressTypeReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<AddressType>("AdventureWorksModel.FK_CustomerAddress_AddressType_AddressTypeID", "AddressType");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<AddressType>("AdventureWorksModel.FK_CustomerAddress_AddressType_AddressTypeID", "AddressType", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_CustomerAddress_Customer_CustomerID", "Customer")]
        public Customer Customer
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Customer>("AdventureWorksModel.FK_CustomerAddress_Customer_CustomerID", "Customer").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Customer>("AdventureWorksModel.FK_CustomerAddress_Customer_CustomerID", "Customer").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Customer> CustomerReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Customer>("AdventureWorksModel.FK_CustomerAddress_Customer_CustomerID", "Customer");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Customer>("AdventureWorksModel.FK_CustomerAddress_Customer_CustomerID", "Customer", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="DatabaseLog")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class DatabaseLog : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new DatabaseLog object.
        /// </summary>
        /// <param name="databaseLogID">Initial value of the DatabaseLogID property.</param>
        /// <param name="postTime">Initial value of the PostTime property.</param>
        /// <param name="databaseUser">Initial value of the DatabaseUser property.</param>
        /// <param name="event">Initial value of the Event property.</param>
        /// <param name="tSQL">Initial value of the TSQL property.</param>
        /// <param name="xmlEvent">Initial value of the XmlEvent property.</param>
        public static DatabaseLog CreateDatabaseLog(global::System.Int32 databaseLogID, global::System.DateTime postTime, global::System.String databaseUser, global::System.String @event, global::System.String tSQL, global::System.String xmlEvent)
        {
            DatabaseLog databaseLog = new DatabaseLog();
            databaseLog.DatabaseLogID = databaseLogID;
            databaseLog.PostTime = postTime;
            databaseLog.DatabaseUser = databaseUser;
            databaseLog.Event = @event;
            databaseLog.TSQL = tSQL;
            databaseLog.XmlEvent = xmlEvent;
            return databaseLog;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 DatabaseLogID
        {
            get
            {
                return _DatabaseLogID;
            }
            set
            {
                if (_DatabaseLogID != value)
                {
                    OnDatabaseLogIDChanging(value);
                    ReportPropertyChanging("DatabaseLogID");
                    _DatabaseLogID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("DatabaseLogID");
                    OnDatabaseLogIDChanged();
                }
            }
        }
        private global::System.Int32 _DatabaseLogID;
        partial void OnDatabaseLogIDChanging(global::System.Int32 value);
        partial void OnDatabaseLogIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime PostTime
        {
            get
            {
                return _PostTime;
            }
            set
            {
                OnPostTimeChanging(value);
                ReportPropertyChanging("PostTime");
                _PostTime = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("PostTime");
                OnPostTimeChanged();
            }
        }
        private global::System.DateTime _PostTime;
        partial void OnPostTimeChanging(global::System.DateTime value);
        partial void OnPostTimeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String DatabaseUser
        {
            get
            {
                return _DatabaseUser;
            }
            set
            {
                OnDatabaseUserChanging(value);
                ReportPropertyChanging("DatabaseUser");
                _DatabaseUser = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("DatabaseUser");
                OnDatabaseUserChanged();
            }
        }
        private global::System.String _DatabaseUser;
        partial void OnDatabaseUserChanging(global::System.String value);
        partial void OnDatabaseUserChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Event
        {
            get
            {
                return _Event;
            }
            set
            {
                OnEventChanging(value);
                ReportPropertyChanging("Event");
                _Event = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Event");
                OnEventChanged();
            }
        }
        private global::System.String _Event;
        partial void OnEventChanging(global::System.String value);
        partial void OnEventChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String Schema
        {
            get
            {
                return _Schema;
            }
            set
            {
                OnSchemaChanging(value);
                ReportPropertyChanging("Schema");
                _Schema = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("Schema");
                OnSchemaChanged();
            }
        }
        private global::System.String _Schema;
        partial void OnSchemaChanging(global::System.String value);
        partial void OnSchemaChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String Object
        {
            get
            {
                return _Object;
            }
            set
            {
                OnObjectChanging(value);
                ReportPropertyChanging("Object");
                _Object = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("Object");
                OnObjectChanged();
            }
        }
        private global::System.String _Object;
        partial void OnObjectChanging(global::System.String value);
        partial void OnObjectChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String TSQL
        {
            get
            {
                return _TSQL;
            }
            set
            {
                OnTSQLChanging(value);
                ReportPropertyChanging("TSQL");
                _TSQL = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("TSQL");
                OnTSQLChanged();
            }
        }
        private global::System.String _TSQL;
        partial void OnTSQLChanging(global::System.String value);
        partial void OnTSQLChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String XmlEvent
        {
            get
            {
                return _XmlEvent;
            }
            set
            {
                OnXmlEventChanging(value);
                ReportPropertyChanging("XmlEvent");
                _XmlEvent = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("XmlEvent");
                OnXmlEventChanged();
            }
        }
        private global::System.String _XmlEvent;
        partial void OnXmlEventChanging(global::System.String value);
        partial void OnXmlEventChanged();

        #endregion
    
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="Department")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class Department : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new Department object.
        /// </summary>
        /// <param name="departmentID">Initial value of the DepartmentID property.</param>
        /// <param name="name">Initial value of the Name property.</param>
        /// <param name="groupName">Initial value of the GroupName property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static Department CreateDepartment(global::System.Int16 departmentID, global::System.String name, global::System.String groupName, global::System.DateTime modifiedDate)
        {
            Department department = new Department();
            department.DepartmentID = departmentID;
            department.Name = name;
            department.GroupName = groupName;
            department.ModifiedDate = modifiedDate;
            return department;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int16 DepartmentID
        {
            get
            {
                return _DepartmentID;
            }
            set
            {
                if (_DepartmentID != value)
                {
                    OnDepartmentIDChanging(value);
                    ReportPropertyChanging("DepartmentID");
                    _DepartmentID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("DepartmentID");
                    OnDepartmentIDChanged();
                }
            }
        }
        private global::System.Int16 _DepartmentID;
        partial void OnDepartmentIDChanging(global::System.Int16 value);
        partial void OnDepartmentIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Name
        {
            get
            {
                return _Name;
            }
            set
            {
                OnNameChanging(value);
                ReportPropertyChanging("Name");
                _Name = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Name");
                OnNameChanged();
            }
        }
        private global::System.String _Name;
        partial void OnNameChanging(global::System.String value);
        partial void OnNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String GroupName
        {
            get
            {
                return _GroupName;
            }
            set
            {
                OnGroupNameChanging(value);
                ReportPropertyChanging("GroupName");
                _GroupName = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("GroupName");
                OnGroupNameChanged();
            }
        }
        private global::System.String _GroupName;
        partial void OnGroupNameChanging(global::System.String value);
        partial void OnGroupNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_EmployeeDepartmentHistory_Department_DepartmentID", "EmployeeDepartmentHistory")]
        public EntityCollection<EmployeeDepartmentHistory> EmployeeDepartmentHistories
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<EmployeeDepartmentHistory>("AdventureWorksModel.FK_EmployeeDepartmentHistory_Department_DepartmentID", "EmployeeDepartmentHistory");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<EmployeeDepartmentHistory>("AdventureWorksModel.FK_EmployeeDepartmentHistory_Department_DepartmentID", "EmployeeDepartmentHistory", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="Document")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class Document : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new Document object.
        /// </summary>
        /// <param name="documentID">Initial value of the DocumentID property.</param>
        /// <param name="title">Initial value of the Title property.</param>
        /// <param name="fileName">Initial value of the FileName property.</param>
        /// <param name="fileExtension">Initial value of the FileExtension property.</param>
        /// <param name="revision">Initial value of the Revision property.</param>
        /// <param name="changeNumber">Initial value of the ChangeNumber property.</param>
        /// <param name="status">Initial value of the Status property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static Document CreateDocument(global::System.Int32 documentID, global::System.String title, global::System.String fileName, global::System.String fileExtension, global::System.String revision, global::System.Int32 changeNumber, global::System.Byte status, global::System.DateTime modifiedDate)
        {
            Document document = new Document();
            document.DocumentID = documentID;
            document.Title = title;
            document.FileName = fileName;
            document.FileExtension = fileExtension;
            document.Revision = revision;
            document.ChangeNumber = changeNumber;
            document.Status = status;
            document.ModifiedDate = modifiedDate;
            return document;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 DocumentID
        {
            get
            {
                return _DocumentID;
            }
            set
            {
                if (_DocumentID != value)
                {
                    OnDocumentIDChanging(value);
                    ReportPropertyChanging("DocumentID");
                    _DocumentID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("DocumentID");
                    OnDocumentIDChanged();
                }
            }
        }
        private global::System.Int32 _DocumentID;
        partial void OnDocumentIDChanging(global::System.Int32 value);
        partial void OnDocumentIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Title
        {
            get
            {
                return _Title;
            }
            set
            {
                OnTitleChanging(value);
                ReportPropertyChanging("Title");
                _Title = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Title");
                OnTitleChanged();
            }
        }
        private global::System.String _Title;
        partial void OnTitleChanging(global::System.String value);
        partial void OnTitleChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String FileName
        {
            get
            {
                return _FileName;
            }
            set
            {
                OnFileNameChanging(value);
                ReportPropertyChanging("FileName");
                _FileName = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("FileName");
                OnFileNameChanged();
            }
        }
        private global::System.String _FileName;
        partial void OnFileNameChanging(global::System.String value);
        partial void OnFileNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String FileExtension
        {
            get
            {
                return _FileExtension;
            }
            set
            {
                OnFileExtensionChanging(value);
                ReportPropertyChanging("FileExtension");
                _FileExtension = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("FileExtension");
                OnFileExtensionChanged();
            }
        }
        private global::System.String _FileExtension;
        partial void OnFileExtensionChanging(global::System.String value);
        partial void OnFileExtensionChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Revision
        {
            get
            {
                return _Revision;
            }
            set
            {
                OnRevisionChanging(value);
                ReportPropertyChanging("Revision");
                _Revision = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Revision");
                OnRevisionChanged();
            }
        }
        private global::System.String _Revision;
        partial void OnRevisionChanging(global::System.String value);
        partial void OnRevisionChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ChangeNumber
        {
            get
            {
                return _ChangeNumber;
            }
            set
            {
                OnChangeNumberChanging(value);
                ReportPropertyChanging("ChangeNumber");
                _ChangeNumber = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ChangeNumber");
                OnChangeNumberChanged();
            }
        }
        private global::System.Int32 _ChangeNumber;
        partial void OnChangeNumberChanging(global::System.Int32 value);
        partial void OnChangeNumberChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Byte Status
        {
            get
            {
                return _Status;
            }
            set
            {
                OnStatusChanging(value);
                ReportPropertyChanging("Status");
                _Status = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("Status");
                OnStatusChanged();
            }
        }
        private global::System.Byte _Status;
        partial void OnStatusChanging(global::System.Byte value);
        partial void OnStatusChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String DocumentSummary
        {
            get
            {
                return _DocumentSummary;
            }
            set
            {
                OnDocumentSummaryChanging(value);
                ReportPropertyChanging("DocumentSummary");
                _DocumentSummary = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("DocumentSummary");
                OnDocumentSummaryChanged();
            }
        }
        private global::System.String _DocumentSummary;
        partial void OnDocumentSummaryChanging(global::System.String value);
        partial void OnDocumentSummaryChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.Byte[] Document1
        {
            get
            {
                return StructuralObject.GetValidValue(_Document1);
            }
            set
            {
                OnDocument1Changing(value);
                ReportPropertyChanging("Document1");
                _Document1 = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("Document1");
                OnDocument1Changed();
            }
        }
        private global::System.Byte[] _Document1;
        partial void OnDocument1Changing(global::System.Byte[] value);
        partial void OnDocument1Changed();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductDocument_Document_DocumentID", "ProductDocument")]
        public EntityCollection<ProductDocument> ProductDocuments
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<ProductDocument>("AdventureWorksModel.FK_ProductDocument_Document_DocumentID", "ProductDocument");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<ProductDocument>("AdventureWorksModel.FK_ProductDocument_Document_DocumentID", "ProductDocument", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="Employee")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class Employee : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new Employee object.
        /// </summary>
        /// <param name="employeeID">Initial value of the EmployeeID property.</param>
        /// <param name="nationalIDNumber">Initial value of the NationalIDNumber property.</param>
        /// <param name="contactID">Initial value of the ContactID property.</param>
        /// <param name="loginID">Initial value of the LoginID property.</param>
        /// <param name="title">Initial value of the Title property.</param>
        /// <param name="birthDate">Initial value of the BirthDate property.</param>
        /// <param name="maritalStatus">Initial value of the MaritalStatus property.</param>
        /// <param name="gender">Initial value of the Gender property.</param>
        /// <param name="hireDate">Initial value of the HireDate property.</param>
        /// <param name="salariedFlag">Initial value of the SalariedFlag property.</param>
        /// <param name="vacationHours">Initial value of the VacationHours property.</param>
        /// <param name="sickLeaveHours">Initial value of the SickLeaveHours property.</param>
        /// <param name="currentFlag">Initial value of the CurrentFlag property.</param>
        /// <param name="rowguid">Initial value of the rowguid property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static Employee CreateEmployee(global::System.Int32 employeeID, global::System.String nationalIDNumber, global::System.Int32 contactID, global::System.String loginID, global::System.String title, global::System.DateTime birthDate, global::System.String maritalStatus, global::System.String gender, global::System.DateTime hireDate, global::System.Boolean salariedFlag, global::System.Int16 vacationHours, global::System.Int16 sickLeaveHours, global::System.Boolean currentFlag, global::System.Guid rowguid, global::System.DateTime modifiedDate)
        {
            Employee employee = new Employee();
            employee.EmployeeID = employeeID;
            employee.NationalIDNumber = nationalIDNumber;
            employee.ContactID = contactID;
            employee.LoginID = loginID;
            employee.Title = title;
            employee.BirthDate = birthDate;
            employee.MaritalStatus = maritalStatus;
            employee.Gender = gender;
            employee.HireDate = hireDate;
            employee.SalariedFlag = salariedFlag;
            employee.VacationHours = vacationHours;
            employee.SickLeaveHours = sickLeaveHours;
            employee.CurrentFlag = currentFlag;
            employee.rowguid = rowguid;
            employee.ModifiedDate = modifiedDate;
            return employee;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 EmployeeID
        {
            get
            {
                return _EmployeeID;
            }
            set
            {
                if (_EmployeeID != value)
                {
                    OnEmployeeIDChanging(value);
                    ReportPropertyChanging("EmployeeID");
                    _EmployeeID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("EmployeeID");
                    OnEmployeeIDChanged();
                }
            }
        }
        private global::System.Int32 _EmployeeID;
        partial void OnEmployeeIDChanging(global::System.Int32 value);
        partial void OnEmployeeIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String NationalIDNumber
        {
            get
            {
                return _NationalIDNumber;
            }
            set
            {
                OnNationalIDNumberChanging(value);
                ReportPropertyChanging("NationalIDNumber");
                _NationalIDNumber = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("NationalIDNumber");
                OnNationalIDNumberChanged();
            }
        }
        private global::System.String _NationalIDNumber;
        partial void OnNationalIDNumberChanging(global::System.String value);
        partial void OnNationalIDNumberChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ContactID
        {
            get
            {
                return _ContactID;
            }
            set
            {
                OnContactIDChanging(value);
                ReportPropertyChanging("ContactID");
                _ContactID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ContactID");
                OnContactIDChanged();
            }
        }
        private global::System.Int32 _ContactID;
        partial void OnContactIDChanging(global::System.Int32 value);
        partial void OnContactIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String LoginID
        {
            get
            {
                return _LoginID;
            }
            set
            {
                OnLoginIDChanging(value);
                ReportPropertyChanging("LoginID");
                _LoginID = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("LoginID");
                OnLoginIDChanged();
            }
        }
        private global::System.String _LoginID;
        partial void OnLoginIDChanging(global::System.String value);
        partial void OnLoginIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> ManagerID
        {
            get
            {
                return _ManagerID;
            }
            set
            {
                OnManagerIDChanging(value);
                ReportPropertyChanging("ManagerID");
                _ManagerID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ManagerID");
                OnManagerIDChanged();
            }
        }
        private Nullable<global::System.Int32> _ManagerID;
        partial void OnManagerIDChanging(Nullable<global::System.Int32> value);
        partial void OnManagerIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Title
        {
            get
            {
                return _Title;
            }
            set
            {
                OnTitleChanging(value);
                ReportPropertyChanging("Title");
                _Title = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Title");
                OnTitleChanged();
            }
        }
        private global::System.String _Title;
        partial void OnTitleChanging(global::System.String value);
        partial void OnTitleChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime BirthDate
        {
            get
            {
                return _BirthDate;
            }
            set
            {
                OnBirthDateChanging(value);
                ReportPropertyChanging("BirthDate");
                _BirthDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("BirthDate");
                OnBirthDateChanged();
            }
        }
        private global::System.DateTime _BirthDate;
        partial void OnBirthDateChanging(global::System.DateTime value);
        partial void OnBirthDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String MaritalStatus
        {
            get
            {
                return _MaritalStatus;
            }
            set
            {
                OnMaritalStatusChanging(value);
                ReportPropertyChanging("MaritalStatus");
                _MaritalStatus = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("MaritalStatus");
                OnMaritalStatusChanged();
            }
        }
        private global::System.String _MaritalStatus;
        partial void OnMaritalStatusChanging(global::System.String value);
        partial void OnMaritalStatusChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Gender
        {
            get
            {
                return _Gender;
            }
            set
            {
                OnGenderChanging(value);
                ReportPropertyChanging("Gender");
                _Gender = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Gender");
                OnGenderChanged();
            }
        }
        private global::System.String _Gender;
        partial void OnGenderChanging(global::System.String value);
        partial void OnGenderChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime HireDate
        {
            get
            {
                return _HireDate;
            }
            set
            {
                OnHireDateChanging(value);
                ReportPropertyChanging("HireDate");
                _HireDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("HireDate");
                OnHireDateChanged();
            }
        }
        private global::System.DateTime _HireDate;
        partial void OnHireDateChanging(global::System.DateTime value);
        partial void OnHireDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Boolean SalariedFlag
        {
            get
            {
                return _SalariedFlag;
            }
            set
            {
                OnSalariedFlagChanging(value);
                ReportPropertyChanging("SalariedFlag");
                _SalariedFlag = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("SalariedFlag");
                OnSalariedFlagChanged();
            }
        }
        private global::System.Boolean _SalariedFlag;
        partial void OnSalariedFlagChanging(global::System.Boolean value);
        partial void OnSalariedFlagChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int16 VacationHours
        {
            get
            {
                return _VacationHours;
            }
            set
            {
                OnVacationHoursChanging(value);
                ReportPropertyChanging("VacationHours");
                _VacationHours = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("VacationHours");
                OnVacationHoursChanged();
            }
        }
        private global::System.Int16 _VacationHours;
        partial void OnVacationHoursChanging(global::System.Int16 value);
        partial void OnVacationHoursChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int16 SickLeaveHours
        {
            get
            {
                return _SickLeaveHours;
            }
            set
            {
                OnSickLeaveHoursChanging(value);
                ReportPropertyChanging("SickLeaveHours");
                _SickLeaveHours = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("SickLeaveHours");
                OnSickLeaveHoursChanged();
            }
        }
        private global::System.Int16 _SickLeaveHours;
        partial void OnSickLeaveHoursChanging(global::System.Int16 value);
        partial void OnSickLeaveHoursChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Boolean CurrentFlag
        {
            get
            {
                return _CurrentFlag;
            }
            set
            {
                OnCurrentFlagChanging(value);
                ReportPropertyChanging("CurrentFlag");
                _CurrentFlag = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("CurrentFlag");
                OnCurrentFlagChanged();
            }
        }
        private global::System.Boolean _CurrentFlag;
        partial void OnCurrentFlagChanging(global::System.Boolean value);
        partial void OnCurrentFlagChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Guid rowguid
        {
            get
            {
                return _rowguid;
            }
            set
            {
                OnrowguidChanging(value);
                ReportPropertyChanging("rowguid");
                _rowguid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("rowguid");
                OnrowguidChanged();
            }
        }
        private global::System.Guid _rowguid;
        partial void OnrowguidChanging(global::System.Guid value);
        partial void OnrowguidChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_Employee_Contact_ContactID", "Contact")]
        public Contact Contact
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Contact>("AdventureWorksModel.FK_Employee_Contact_ContactID", "Contact").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Contact>("AdventureWorksModel.FK_Employee_Contact_ContactID", "Contact").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Contact> ContactReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Contact>("AdventureWorksModel.FK_Employee_Contact_ContactID", "Contact");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Contact>("AdventureWorksModel.FK_Employee_Contact_ContactID", "Contact", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_Employee_Employee_ManagerID", "Employee1")]
        public EntityCollection<Employee> Employee1
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<Employee>("AdventureWorksModel.FK_Employee_Employee_ManagerID", "Employee1");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<Employee>("AdventureWorksModel.FK_Employee_Employee_ManagerID", "Employee1", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_Employee_Employee_ManagerID", "Employee")]
        public Employee Employee2
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Employee>("AdventureWorksModel.FK_Employee_Employee_ManagerID", "Employee").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Employee>("AdventureWorksModel.FK_Employee_Employee_ManagerID", "Employee").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Employee> Employee2Reference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Employee>("AdventureWorksModel.FK_Employee_Employee_ManagerID", "Employee");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Employee>("AdventureWorksModel.FK_Employee_Employee_ManagerID", "Employee", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_EmployeeAddress_Employee_EmployeeID", "EmployeeAddress")]
        public EntityCollection<EmployeeAddress> EmployeeAddresses
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<EmployeeAddress>("AdventureWorksModel.FK_EmployeeAddress_Employee_EmployeeID", "EmployeeAddress");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<EmployeeAddress>("AdventureWorksModel.FK_EmployeeAddress_Employee_EmployeeID", "EmployeeAddress", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_EmployeeDepartmentHistory_Employee_EmployeeID", "EmployeeDepartmentHistory")]
        public EntityCollection<EmployeeDepartmentHistory> EmployeeDepartmentHistories
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<EmployeeDepartmentHistory>("AdventureWorksModel.FK_EmployeeDepartmentHistory_Employee_EmployeeID", "EmployeeDepartmentHistory");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<EmployeeDepartmentHistory>("AdventureWorksModel.FK_EmployeeDepartmentHistory_Employee_EmployeeID", "EmployeeDepartmentHistory", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_EmployeePayHistory_Employee_EmployeeID", "EmployeePayHistory")]
        public EntityCollection<EmployeePayHistory> EmployeePayHistories
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<EmployeePayHistory>("AdventureWorksModel.FK_EmployeePayHistory_Employee_EmployeeID", "EmployeePayHistory");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<EmployeePayHistory>("AdventureWorksModel.FK_EmployeePayHistory_Employee_EmployeeID", "EmployeePayHistory", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_JobCandidate_Employee_EmployeeID", "JobCandidate")]
        public EntityCollection<JobCandidate> JobCandidates
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<JobCandidate>("AdventureWorksModel.FK_JobCandidate_Employee_EmployeeID", "JobCandidate");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<JobCandidate>("AdventureWorksModel.FK_JobCandidate_Employee_EmployeeID", "JobCandidate", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_PurchaseOrderHeader_Employee_EmployeeID", "PurchaseOrderHeader")]
        public EntityCollection<PurchaseOrderHeader> PurchaseOrderHeaders
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<PurchaseOrderHeader>("AdventureWorksModel.FK_PurchaseOrderHeader_Employee_EmployeeID", "PurchaseOrderHeader");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<PurchaseOrderHeader>("AdventureWorksModel.FK_PurchaseOrderHeader_Employee_EmployeeID", "PurchaseOrderHeader", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesPerson_Employee_SalesPersonID", "SalesPerson")]
        public SalesPerson SalesPerson
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesPerson>("AdventureWorksModel.FK_SalesPerson_Employee_SalesPersonID", "SalesPerson").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesPerson>("AdventureWorksModel.FK_SalesPerson_Employee_SalesPersonID", "SalesPerson").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<SalesPerson> SalesPersonReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesPerson>("AdventureWorksModel.FK_SalesPerson_Employee_SalesPersonID", "SalesPerson");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<SalesPerson>("AdventureWorksModel.FK_SalesPerson_Employee_SalesPersonID", "SalesPerson", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="EmployeeAddress")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class EmployeeAddress : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new EmployeeAddress object.
        /// </summary>
        /// <param name="employeeID">Initial value of the EmployeeID property.</param>
        /// <param name="addressID">Initial value of the AddressID property.</param>
        /// <param name="rowguid">Initial value of the rowguid property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static EmployeeAddress CreateEmployeeAddress(global::System.Int32 employeeID, global::System.Int32 addressID, global::System.Guid rowguid, global::System.DateTime modifiedDate)
        {
            EmployeeAddress employeeAddress = new EmployeeAddress();
            employeeAddress.EmployeeID = employeeID;
            employeeAddress.AddressID = addressID;
            employeeAddress.rowguid = rowguid;
            employeeAddress.ModifiedDate = modifiedDate;
            return employeeAddress;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 EmployeeID
        {
            get
            {
                return _EmployeeID;
            }
            set
            {
                if (_EmployeeID != value)
                {
                    OnEmployeeIDChanging(value);
                    ReportPropertyChanging("EmployeeID");
                    _EmployeeID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("EmployeeID");
                    OnEmployeeIDChanged();
                }
            }
        }
        private global::System.Int32 _EmployeeID;
        partial void OnEmployeeIDChanging(global::System.Int32 value);
        partial void OnEmployeeIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 AddressID
        {
            get
            {
                return _AddressID;
            }
            set
            {
                if (_AddressID != value)
                {
                    OnAddressIDChanging(value);
                    ReportPropertyChanging("AddressID");
                    _AddressID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("AddressID");
                    OnAddressIDChanged();
                }
            }
        }
        private global::System.Int32 _AddressID;
        partial void OnAddressIDChanging(global::System.Int32 value);
        partial void OnAddressIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Guid rowguid
        {
            get
            {
                return _rowguid;
            }
            set
            {
                OnrowguidChanging(value);
                ReportPropertyChanging("rowguid");
                _rowguid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("rowguid");
                OnrowguidChanged();
            }
        }
        private global::System.Guid _rowguid;
        partial void OnrowguidChanging(global::System.Guid value);
        partial void OnrowguidChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_EmployeeAddress_Employee_EmployeeID", "Employee")]
        public Employee Employee
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Employee>("AdventureWorksModel.FK_EmployeeAddress_Employee_EmployeeID", "Employee").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Employee>("AdventureWorksModel.FK_EmployeeAddress_Employee_EmployeeID", "Employee").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Employee> EmployeeReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Employee>("AdventureWorksModel.FK_EmployeeAddress_Employee_EmployeeID", "Employee");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Employee>("AdventureWorksModel.FK_EmployeeAddress_Employee_EmployeeID", "Employee", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_EmployeeAddress_Address_AddressID", "Address")]
        public Address Address
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Address>("AdventureWorksModel.FK_EmployeeAddress_Address_AddressID", "Address").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Address>("AdventureWorksModel.FK_EmployeeAddress_Address_AddressID", "Address").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Address> AddressReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Address>("AdventureWorksModel.FK_EmployeeAddress_Address_AddressID", "Address");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Address>("AdventureWorksModel.FK_EmployeeAddress_Address_AddressID", "Address", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="EmployeeDepartmentHistory")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class EmployeeDepartmentHistory : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new EmployeeDepartmentHistory object.
        /// </summary>
        /// <param name="employeeID">Initial value of the EmployeeID property.</param>
        /// <param name="departmentID">Initial value of the DepartmentID property.</param>
        /// <param name="shiftID">Initial value of the ShiftID property.</param>
        /// <param name="startDate">Initial value of the StartDate property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static EmployeeDepartmentHistory CreateEmployeeDepartmentHistory(global::System.Int32 employeeID, global::System.Int16 departmentID, global::System.Byte shiftID, global::System.DateTime startDate, global::System.DateTime modifiedDate)
        {
            EmployeeDepartmentHistory employeeDepartmentHistory = new EmployeeDepartmentHistory();
            employeeDepartmentHistory.EmployeeID = employeeID;
            employeeDepartmentHistory.DepartmentID = departmentID;
            employeeDepartmentHistory.ShiftID = shiftID;
            employeeDepartmentHistory.StartDate = startDate;
            employeeDepartmentHistory.ModifiedDate = modifiedDate;
            return employeeDepartmentHistory;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 EmployeeID
        {
            get
            {
                return _EmployeeID;
            }
            set
            {
                if (_EmployeeID != value)
                {
                    OnEmployeeIDChanging(value);
                    ReportPropertyChanging("EmployeeID");
                    _EmployeeID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("EmployeeID");
                    OnEmployeeIDChanged();
                }
            }
        }
        private global::System.Int32 _EmployeeID;
        partial void OnEmployeeIDChanging(global::System.Int32 value);
        partial void OnEmployeeIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int16 DepartmentID
        {
            get
            {
                return _DepartmentID;
            }
            set
            {
                if (_DepartmentID != value)
                {
                    OnDepartmentIDChanging(value);
                    ReportPropertyChanging("DepartmentID");
                    _DepartmentID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("DepartmentID");
                    OnDepartmentIDChanged();
                }
            }
        }
        private global::System.Int16 _DepartmentID;
        partial void OnDepartmentIDChanging(global::System.Int16 value);
        partial void OnDepartmentIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Byte ShiftID
        {
            get
            {
                return _ShiftID;
            }
            set
            {
                if (_ShiftID != value)
                {
                    OnShiftIDChanging(value);
                    ReportPropertyChanging("ShiftID");
                    _ShiftID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ShiftID");
                    OnShiftIDChanged();
                }
            }
        }
        private global::System.Byte _ShiftID;
        partial void OnShiftIDChanging(global::System.Byte value);
        partial void OnShiftIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime StartDate
        {
            get
            {
                return _StartDate;
            }
            set
            {
                if (_StartDate != value)
                {
                    OnStartDateChanging(value);
                    ReportPropertyChanging("StartDate");
                    _StartDate = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("StartDate");
                    OnStartDateChanged();
                }
            }
        }
        private global::System.DateTime _StartDate;
        partial void OnStartDateChanging(global::System.DateTime value);
        partial void OnStartDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.DateTime> EndDate
        {
            get
            {
                return _EndDate;
            }
            set
            {
                OnEndDateChanging(value);
                ReportPropertyChanging("EndDate");
                _EndDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("EndDate");
                OnEndDateChanged();
            }
        }
        private Nullable<global::System.DateTime> _EndDate;
        partial void OnEndDateChanging(Nullable<global::System.DateTime> value);
        partial void OnEndDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_EmployeeDepartmentHistory_Department_DepartmentID", "Department")]
        public Department Department
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Department>("AdventureWorksModel.FK_EmployeeDepartmentHistory_Department_DepartmentID", "Department").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Department>("AdventureWorksModel.FK_EmployeeDepartmentHistory_Department_DepartmentID", "Department").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Department> DepartmentReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Department>("AdventureWorksModel.FK_EmployeeDepartmentHistory_Department_DepartmentID", "Department");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Department>("AdventureWorksModel.FK_EmployeeDepartmentHistory_Department_DepartmentID", "Department", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_EmployeeDepartmentHistory_Employee_EmployeeID", "Employee")]
        public Employee Employee
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Employee>("AdventureWorksModel.FK_EmployeeDepartmentHistory_Employee_EmployeeID", "Employee").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Employee>("AdventureWorksModel.FK_EmployeeDepartmentHistory_Employee_EmployeeID", "Employee").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Employee> EmployeeReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Employee>("AdventureWorksModel.FK_EmployeeDepartmentHistory_Employee_EmployeeID", "Employee");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Employee>("AdventureWorksModel.FK_EmployeeDepartmentHistory_Employee_EmployeeID", "Employee", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_EmployeeDepartmentHistory_Shift_ShiftID", "Shift")]
        public Shift Shift
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Shift>("AdventureWorksModel.FK_EmployeeDepartmentHistory_Shift_ShiftID", "Shift").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Shift>("AdventureWorksModel.FK_EmployeeDepartmentHistory_Shift_ShiftID", "Shift").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Shift> ShiftReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Shift>("AdventureWorksModel.FK_EmployeeDepartmentHistory_Shift_ShiftID", "Shift");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Shift>("AdventureWorksModel.FK_EmployeeDepartmentHistory_Shift_ShiftID", "Shift", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="EmployeePayHistory")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class EmployeePayHistory : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new EmployeePayHistory object.
        /// </summary>
        /// <param name="employeeID">Initial value of the EmployeeID property.</param>
        /// <param name="rateChangeDate">Initial value of the RateChangeDate property.</param>
        /// <param name="rate">Initial value of the Rate property.</param>
        /// <param name="payFrequency">Initial value of the PayFrequency property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static EmployeePayHistory CreateEmployeePayHistory(global::System.Int32 employeeID, global::System.DateTime rateChangeDate, global::System.Decimal rate, global::System.Byte payFrequency, global::System.DateTime modifiedDate)
        {
            EmployeePayHistory employeePayHistory = new EmployeePayHistory();
            employeePayHistory.EmployeeID = employeeID;
            employeePayHistory.RateChangeDate = rateChangeDate;
            employeePayHistory.Rate = rate;
            employeePayHistory.PayFrequency = payFrequency;
            employeePayHistory.ModifiedDate = modifiedDate;
            return employeePayHistory;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 EmployeeID
        {
            get
            {
                return _EmployeeID;
            }
            set
            {
                if (_EmployeeID != value)
                {
                    OnEmployeeIDChanging(value);
                    ReportPropertyChanging("EmployeeID");
                    _EmployeeID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("EmployeeID");
                    OnEmployeeIDChanged();
                }
            }
        }
        private global::System.Int32 _EmployeeID;
        partial void OnEmployeeIDChanging(global::System.Int32 value);
        partial void OnEmployeeIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime RateChangeDate
        {
            get
            {
                return _RateChangeDate;
            }
            set
            {
                if (_RateChangeDate != value)
                {
                    OnRateChangeDateChanging(value);
                    ReportPropertyChanging("RateChangeDate");
                    _RateChangeDate = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("RateChangeDate");
                    OnRateChangeDateChanged();
                }
            }
        }
        private global::System.DateTime _RateChangeDate;
        partial void OnRateChangeDateChanging(global::System.DateTime value);
        partial void OnRateChangeDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal Rate
        {
            get
            {
                return _Rate;
            }
            set
            {
                OnRateChanging(value);
                ReportPropertyChanging("Rate");
                _Rate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("Rate");
                OnRateChanged();
            }
        }
        private global::System.Decimal _Rate;
        partial void OnRateChanging(global::System.Decimal value);
        partial void OnRateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Byte PayFrequency
        {
            get
            {
                return _PayFrequency;
            }
            set
            {
                OnPayFrequencyChanging(value);
                ReportPropertyChanging("PayFrequency");
                _PayFrequency = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("PayFrequency");
                OnPayFrequencyChanged();
            }
        }
        private global::System.Byte _PayFrequency;
        partial void OnPayFrequencyChanging(global::System.Byte value);
        partial void OnPayFrequencyChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_EmployeePayHistory_Employee_EmployeeID", "Employee")]
        public Employee Employee
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Employee>("AdventureWorksModel.FK_EmployeePayHistory_Employee_EmployeeID", "Employee").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Employee>("AdventureWorksModel.FK_EmployeePayHistory_Employee_EmployeeID", "Employee").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Employee> EmployeeReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Employee>("AdventureWorksModel.FK_EmployeePayHistory_Employee_EmployeeID", "Employee");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Employee>("AdventureWorksModel.FK_EmployeePayHistory_Employee_EmployeeID", "Employee", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="ErrorLog")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class ErrorLog : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new ErrorLog object.
        /// </summary>
        /// <param name="errorLogID">Initial value of the ErrorLogID property.</param>
        /// <param name="errorTime">Initial value of the ErrorTime property.</param>
        /// <param name="userName">Initial value of the UserName property.</param>
        /// <param name="errorNumber">Initial value of the ErrorNumber property.</param>
        /// <param name="errorMessage">Initial value of the ErrorMessage property.</param>
        public static ErrorLog CreateErrorLog(global::System.Int32 errorLogID, global::System.DateTime errorTime, global::System.String userName, global::System.Int32 errorNumber, global::System.String errorMessage)
        {
            ErrorLog errorLog = new ErrorLog();
            errorLog.ErrorLogID = errorLogID;
            errorLog.ErrorTime = errorTime;
            errorLog.UserName = userName;
            errorLog.ErrorNumber = errorNumber;
            errorLog.ErrorMessage = errorMessage;
            return errorLog;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ErrorLogID
        {
            get
            {
                return _ErrorLogID;
            }
            set
            {
                if (_ErrorLogID != value)
                {
                    OnErrorLogIDChanging(value);
                    ReportPropertyChanging("ErrorLogID");
                    _ErrorLogID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ErrorLogID");
                    OnErrorLogIDChanged();
                }
            }
        }
        private global::System.Int32 _ErrorLogID;
        partial void OnErrorLogIDChanging(global::System.Int32 value);
        partial void OnErrorLogIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ErrorTime
        {
            get
            {
                return _ErrorTime;
            }
            set
            {
                OnErrorTimeChanging(value);
                ReportPropertyChanging("ErrorTime");
                _ErrorTime = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ErrorTime");
                OnErrorTimeChanged();
            }
        }
        private global::System.DateTime _ErrorTime;
        partial void OnErrorTimeChanging(global::System.DateTime value);
        partial void OnErrorTimeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String UserName
        {
            get
            {
                return _UserName;
            }
            set
            {
                OnUserNameChanging(value);
                ReportPropertyChanging("UserName");
                _UserName = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("UserName");
                OnUserNameChanged();
            }
        }
        private global::System.String _UserName;
        partial void OnUserNameChanging(global::System.String value);
        partial void OnUserNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ErrorNumber
        {
            get
            {
                return _ErrorNumber;
            }
            set
            {
                OnErrorNumberChanging(value);
                ReportPropertyChanging("ErrorNumber");
                _ErrorNumber = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ErrorNumber");
                OnErrorNumberChanged();
            }
        }
        private global::System.Int32 _ErrorNumber;
        partial void OnErrorNumberChanging(global::System.Int32 value);
        partial void OnErrorNumberChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> ErrorSeverity
        {
            get
            {
                return _ErrorSeverity;
            }
            set
            {
                OnErrorSeverityChanging(value);
                ReportPropertyChanging("ErrorSeverity");
                _ErrorSeverity = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ErrorSeverity");
                OnErrorSeverityChanged();
            }
        }
        private Nullable<global::System.Int32> _ErrorSeverity;
        partial void OnErrorSeverityChanging(Nullable<global::System.Int32> value);
        partial void OnErrorSeverityChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> ErrorState
        {
            get
            {
                return _ErrorState;
            }
            set
            {
                OnErrorStateChanging(value);
                ReportPropertyChanging("ErrorState");
                _ErrorState = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ErrorState");
                OnErrorStateChanged();
            }
        }
        private Nullable<global::System.Int32> _ErrorState;
        partial void OnErrorStateChanging(Nullable<global::System.Int32> value);
        partial void OnErrorStateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String ErrorProcedure
        {
            get
            {
                return _ErrorProcedure;
            }
            set
            {
                OnErrorProcedureChanging(value);
                ReportPropertyChanging("ErrorProcedure");
                _ErrorProcedure = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("ErrorProcedure");
                OnErrorProcedureChanged();
            }
        }
        private global::System.String _ErrorProcedure;
        partial void OnErrorProcedureChanging(global::System.String value);
        partial void OnErrorProcedureChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> ErrorLine
        {
            get
            {
                return _ErrorLine;
            }
            set
            {
                OnErrorLineChanging(value);
                ReportPropertyChanging("ErrorLine");
                _ErrorLine = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ErrorLine");
                OnErrorLineChanged();
            }
        }
        private Nullable<global::System.Int32> _ErrorLine;
        partial void OnErrorLineChanging(Nullable<global::System.Int32> value);
        partial void OnErrorLineChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String ErrorMessage
        {
            get
            {
                return _ErrorMessage;
            }
            set
            {
                OnErrorMessageChanging(value);
                ReportPropertyChanging("ErrorMessage");
                _ErrorMessage = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("ErrorMessage");
                OnErrorMessageChanged();
            }
        }
        private global::System.String _ErrorMessage;
        partial void OnErrorMessageChanging(global::System.String value);
        partial void OnErrorMessageChanged();

        #endregion
    
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="Illustration")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class Illustration : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new Illustration object.
        /// </summary>
        /// <param name="illustrationID">Initial value of the IllustrationID property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static Illustration CreateIllustration(global::System.Int32 illustrationID, global::System.DateTime modifiedDate)
        {
            Illustration illustration = new Illustration();
            illustration.IllustrationID = illustrationID;
            illustration.ModifiedDate = modifiedDate;
            return illustration;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 IllustrationID
        {
            get
            {
                return _IllustrationID;
            }
            set
            {
                if (_IllustrationID != value)
                {
                    OnIllustrationIDChanging(value);
                    ReportPropertyChanging("IllustrationID");
                    _IllustrationID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("IllustrationID");
                    OnIllustrationIDChanged();
                }
            }
        }
        private global::System.Int32 _IllustrationID;
        partial void OnIllustrationIDChanging(global::System.Int32 value);
        partial void OnIllustrationIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String Diagram
        {
            get
            {
                return _Diagram;
            }
            set
            {
                OnDiagramChanging(value);
                ReportPropertyChanging("Diagram");
                _Diagram = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("Diagram");
                OnDiagramChanged();
            }
        }
        private global::System.String _Diagram;
        partial void OnDiagramChanging(global::System.String value);
        partial void OnDiagramChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductModelIllustration_Illustration_IllustrationID", "ProductModelIllustration")]
        public EntityCollection<ProductModelIllustration> ProductModelIllustrations
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<ProductModelIllustration>("AdventureWorksModel.FK_ProductModelIllustration_Illustration_IllustrationID", "ProductModelIllustration");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<ProductModelIllustration>("AdventureWorksModel.FK_ProductModelIllustration_Illustration_IllustrationID", "ProductModelIllustration", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="Individual")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class Individual : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new Individual object.
        /// </summary>
        /// <param name="customerID">Initial value of the CustomerID property.</param>
        /// <param name="contactID">Initial value of the ContactID property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static Individual CreateIndividual(global::System.Int32 customerID, global::System.Int32 contactID, global::System.DateTime modifiedDate)
        {
            Individual individual = new Individual();
            individual.CustomerID = customerID;
            individual.ContactID = contactID;
            individual.ModifiedDate = modifiedDate;
            return individual;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 CustomerID
        {
            get
            {
                return _CustomerID;
            }
            set
            {
                if (_CustomerID != value)
                {
                    OnCustomerIDChanging(value);
                    ReportPropertyChanging("CustomerID");
                    _CustomerID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("CustomerID");
                    OnCustomerIDChanged();
                }
            }
        }
        private global::System.Int32 _CustomerID;
        partial void OnCustomerIDChanging(global::System.Int32 value);
        partial void OnCustomerIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ContactID
        {
            get
            {
                return _ContactID;
            }
            set
            {
                OnContactIDChanging(value);
                ReportPropertyChanging("ContactID");
                _ContactID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ContactID");
                OnContactIDChanged();
            }
        }
        private global::System.Int32 _ContactID;
        partial void OnContactIDChanging(global::System.Int32 value);
        partial void OnContactIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String Demographics
        {
            get
            {
                return _Demographics;
            }
            set
            {
                OnDemographicsChanging(value);
                ReportPropertyChanging("Demographics");
                _Demographics = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("Demographics");
                OnDemographicsChanged();
            }
        }
        private global::System.String _Demographics;
        partial void OnDemographicsChanging(global::System.String value);
        partial void OnDemographicsChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_Individual_Contact_ContactID", "Contact")]
        public Contact Contact
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Contact>("AdventureWorksModel.FK_Individual_Contact_ContactID", "Contact").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Contact>("AdventureWorksModel.FK_Individual_Contact_ContactID", "Contact").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Contact> ContactReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Contact>("AdventureWorksModel.FK_Individual_Contact_ContactID", "Contact");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Contact>("AdventureWorksModel.FK_Individual_Contact_ContactID", "Contact", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_Individual_Customer_CustomerID", "Customer")]
        public Customer Customer
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Customer>("AdventureWorksModel.FK_Individual_Customer_CustomerID", "Customer").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Customer>("AdventureWorksModel.FK_Individual_Customer_CustomerID", "Customer").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Customer> CustomerReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Customer>("AdventureWorksModel.FK_Individual_Customer_CustomerID", "Customer");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Customer>("AdventureWorksModel.FK_Individual_Customer_CustomerID", "Customer", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="JobCandidate")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class JobCandidate : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new JobCandidate object.
        /// </summary>
        /// <param name="jobCandidateID">Initial value of the JobCandidateID property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static JobCandidate CreateJobCandidate(global::System.Int32 jobCandidateID, global::System.DateTime modifiedDate)
        {
            JobCandidate jobCandidate = new JobCandidate();
            jobCandidate.JobCandidateID = jobCandidateID;
            jobCandidate.ModifiedDate = modifiedDate;
            return jobCandidate;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 JobCandidateID
        {
            get
            {
                return _JobCandidateID;
            }
            set
            {
                if (_JobCandidateID != value)
                {
                    OnJobCandidateIDChanging(value);
                    ReportPropertyChanging("JobCandidateID");
                    _JobCandidateID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("JobCandidateID");
                    OnJobCandidateIDChanged();
                }
            }
        }
        private global::System.Int32 _JobCandidateID;
        partial void OnJobCandidateIDChanging(global::System.Int32 value);
        partial void OnJobCandidateIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> EmployeeID
        {
            get
            {
                return _EmployeeID;
            }
            set
            {
                OnEmployeeIDChanging(value);
                ReportPropertyChanging("EmployeeID");
                _EmployeeID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("EmployeeID");
                OnEmployeeIDChanged();
            }
        }
        private Nullable<global::System.Int32> _EmployeeID;
        partial void OnEmployeeIDChanging(Nullable<global::System.Int32> value);
        partial void OnEmployeeIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String Resume
        {
            get
            {
                return _Resume;
            }
            set
            {
                OnResumeChanging(value);
                ReportPropertyChanging("Resume");
                _Resume = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("Resume");
                OnResumeChanged();
            }
        }
        private global::System.String _Resume;
        partial void OnResumeChanging(global::System.String value);
        partial void OnResumeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_JobCandidate_Employee_EmployeeID", "Employee")]
        public Employee Employee
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Employee>("AdventureWorksModel.FK_JobCandidate_Employee_EmployeeID", "Employee").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Employee>("AdventureWorksModel.FK_JobCandidate_Employee_EmployeeID", "Employee").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Employee> EmployeeReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Employee>("AdventureWorksModel.FK_JobCandidate_Employee_EmployeeID", "Employee");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Employee>("AdventureWorksModel.FK_JobCandidate_Employee_EmployeeID", "Employee", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="Location")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class Location : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new Location object.
        /// </summary>
        /// <param name="locationID">Initial value of the LocationID property.</param>
        /// <param name="name">Initial value of the Name property.</param>
        /// <param name="costRate">Initial value of the CostRate property.</param>
        /// <param name="availability">Initial value of the Availability property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static Location CreateLocation(global::System.Int16 locationID, global::System.String name, global::System.Decimal costRate, global::System.Decimal availability, global::System.DateTime modifiedDate)
        {
            Location location = new Location();
            location.LocationID = locationID;
            location.Name = name;
            location.CostRate = costRate;
            location.Availability = availability;
            location.ModifiedDate = modifiedDate;
            return location;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int16 LocationID
        {
            get
            {
                return _LocationID;
            }
            set
            {
                if (_LocationID != value)
                {
                    OnLocationIDChanging(value);
                    ReportPropertyChanging("LocationID");
                    _LocationID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("LocationID");
                    OnLocationIDChanged();
                }
            }
        }
        private global::System.Int16 _LocationID;
        partial void OnLocationIDChanging(global::System.Int16 value);
        partial void OnLocationIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Name
        {
            get
            {
                return _Name;
            }
            set
            {
                OnNameChanging(value);
                ReportPropertyChanging("Name");
                _Name = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Name");
                OnNameChanged();
            }
        }
        private global::System.String _Name;
        partial void OnNameChanging(global::System.String value);
        partial void OnNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal CostRate
        {
            get
            {
                return _CostRate;
            }
            set
            {
                OnCostRateChanging(value);
                ReportPropertyChanging("CostRate");
                _CostRate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("CostRate");
                OnCostRateChanged();
            }
        }
        private global::System.Decimal _CostRate;
        partial void OnCostRateChanging(global::System.Decimal value);
        partial void OnCostRateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal Availability
        {
            get
            {
                return _Availability;
            }
            set
            {
                OnAvailabilityChanging(value);
                ReportPropertyChanging("Availability");
                _Availability = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("Availability");
                OnAvailabilityChanged();
            }
        }
        private global::System.Decimal _Availability;
        partial void OnAvailabilityChanging(global::System.Decimal value);
        partial void OnAvailabilityChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductInventory_Location_LocationID", "ProductInventory")]
        public EntityCollection<ProductInventory> ProductInventories
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<ProductInventory>("AdventureWorksModel.FK_ProductInventory_Location_LocationID", "ProductInventory");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<ProductInventory>("AdventureWorksModel.FK_ProductInventory_Location_LocationID", "ProductInventory", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_WorkOrderRouting_Location_LocationID", "WorkOrderRouting")]
        public EntityCollection<WorkOrderRouting> WorkOrderRoutings
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<WorkOrderRouting>("AdventureWorksModel.FK_WorkOrderRouting_Location_LocationID", "WorkOrderRouting");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<WorkOrderRouting>("AdventureWorksModel.FK_WorkOrderRouting_Location_LocationID", "WorkOrderRouting", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="Product")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class Product : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new Product object.
        /// </summary>
        /// <param name="productID">Initial value of the ProductID property.</param>
        /// <param name="name">Initial value of the Name property.</param>
        /// <param name="productNumber">Initial value of the ProductNumber property.</param>
        /// <param name="makeFlag">Initial value of the MakeFlag property.</param>
        /// <param name="finishedGoodsFlag">Initial value of the FinishedGoodsFlag property.</param>
        /// <param name="safetyStockLevel">Initial value of the SafetyStockLevel property.</param>
        /// <param name="reorderPoint">Initial value of the ReorderPoint property.</param>
        /// <param name="standardCost">Initial value of the StandardCost property.</param>
        /// <param name="listPrice">Initial value of the ListPrice property.</param>
        /// <param name="daysToManufacture">Initial value of the DaysToManufacture property.</param>
        /// <param name="sellStartDate">Initial value of the SellStartDate property.</param>
        /// <param name="rowguid">Initial value of the rowguid property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static Product CreateProduct(global::System.Int32 productID, global::System.String name, global::System.String productNumber, global::System.Boolean makeFlag, global::System.Boolean finishedGoodsFlag, global::System.Int16 safetyStockLevel, global::System.Int16 reorderPoint, global::System.Decimal standardCost, global::System.Decimal listPrice, global::System.Int32 daysToManufacture, global::System.DateTime sellStartDate, global::System.Guid rowguid, global::System.DateTime modifiedDate)
        {
            Product product = new Product();
            product.ProductID = productID;
            product.Name = name;
            product.ProductNumber = productNumber;
            product.MakeFlag = makeFlag;
            product.FinishedGoodsFlag = finishedGoodsFlag;
            product.SafetyStockLevel = safetyStockLevel;
            product.ReorderPoint = reorderPoint;
            product.StandardCost = standardCost;
            product.ListPrice = listPrice;
            product.DaysToManufacture = daysToManufacture;
            product.SellStartDate = sellStartDate;
            product.rowguid = rowguid;
            product.ModifiedDate = modifiedDate;
            return product;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ProductID
        {
            get
            {
                return _ProductID;
            }
            set
            {
                if (_ProductID != value)
                {
                    OnProductIDChanging(value);
                    ReportPropertyChanging("ProductID");
                    _ProductID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ProductID");
                    OnProductIDChanged();
                }
            }
        }
        private global::System.Int32 _ProductID;
        partial void OnProductIDChanging(global::System.Int32 value);
        partial void OnProductIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Name
        {
            get
            {
                return _Name;
            }
            set
            {
                OnNameChanging(value);
                ReportPropertyChanging("Name");
                _Name = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Name");
                OnNameChanged();
            }
        }
        private global::System.String _Name;
        partial void OnNameChanging(global::System.String value);
        partial void OnNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String ProductNumber
        {
            get
            {
                return _ProductNumber;
            }
            set
            {
                OnProductNumberChanging(value);
                ReportPropertyChanging("ProductNumber");
                _ProductNumber = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("ProductNumber");
                OnProductNumberChanged();
            }
        }
        private global::System.String _ProductNumber;
        partial void OnProductNumberChanging(global::System.String value);
        partial void OnProductNumberChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Boolean MakeFlag
        {
            get
            {
                return _MakeFlag;
            }
            set
            {
                OnMakeFlagChanging(value);
                ReportPropertyChanging("MakeFlag");
                _MakeFlag = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("MakeFlag");
                OnMakeFlagChanged();
            }
        }
        private global::System.Boolean _MakeFlag;
        partial void OnMakeFlagChanging(global::System.Boolean value);
        partial void OnMakeFlagChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Boolean FinishedGoodsFlag
        {
            get
            {
                return _FinishedGoodsFlag;
            }
            set
            {
                OnFinishedGoodsFlagChanging(value);
                ReportPropertyChanging("FinishedGoodsFlag");
                _FinishedGoodsFlag = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("FinishedGoodsFlag");
                OnFinishedGoodsFlagChanged();
            }
        }
        private global::System.Boolean _FinishedGoodsFlag;
        partial void OnFinishedGoodsFlagChanging(global::System.Boolean value);
        partial void OnFinishedGoodsFlagChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String Color
        {
            get
            {
                return _Color;
            }
            set
            {
                OnColorChanging(value);
                ReportPropertyChanging("Color");
                _Color = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("Color");
                OnColorChanged();
            }
        }
        private global::System.String _Color;
        partial void OnColorChanging(global::System.String value);
        partial void OnColorChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int16 SafetyStockLevel
        {
            get
            {
                return _SafetyStockLevel;
            }
            set
            {
                OnSafetyStockLevelChanging(value);
                ReportPropertyChanging("SafetyStockLevel");
                _SafetyStockLevel = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("SafetyStockLevel");
                OnSafetyStockLevelChanged();
            }
        }
        private global::System.Int16 _SafetyStockLevel;
        partial void OnSafetyStockLevelChanging(global::System.Int16 value);
        partial void OnSafetyStockLevelChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int16 ReorderPoint
        {
            get
            {
                return _ReorderPoint;
            }
            set
            {
                OnReorderPointChanging(value);
                ReportPropertyChanging("ReorderPoint");
                _ReorderPoint = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ReorderPoint");
                OnReorderPointChanged();
            }
        }
        private global::System.Int16 _ReorderPoint;
        partial void OnReorderPointChanging(global::System.Int16 value);
        partial void OnReorderPointChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal StandardCost
        {
            get
            {
                return _StandardCost;
            }
            set
            {
                OnStandardCostChanging(value);
                ReportPropertyChanging("StandardCost");
                _StandardCost = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("StandardCost");
                OnStandardCostChanged();
            }
        }
        private global::System.Decimal _StandardCost;
        partial void OnStandardCostChanging(global::System.Decimal value);
        partial void OnStandardCostChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal ListPrice
        {
            get
            {
                return _ListPrice;
            }
            set
            {
                OnListPriceChanging(value);
                ReportPropertyChanging("ListPrice");
                _ListPrice = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ListPrice");
                OnListPriceChanged();
            }
        }
        private global::System.Decimal _ListPrice;
        partial void OnListPriceChanging(global::System.Decimal value);
        partial void OnListPriceChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String Size
        {
            get
            {
                return _Size;
            }
            set
            {
                OnSizeChanging(value);
                ReportPropertyChanging("Size");
                _Size = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("Size");
                OnSizeChanged();
            }
        }
        private global::System.String _Size;
        partial void OnSizeChanging(global::System.String value);
        partial void OnSizeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String SizeUnitMeasureCode
        {
            get
            {
                return _SizeUnitMeasureCode;
            }
            set
            {
                OnSizeUnitMeasureCodeChanging(value);
                ReportPropertyChanging("SizeUnitMeasureCode");
                _SizeUnitMeasureCode = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("SizeUnitMeasureCode");
                OnSizeUnitMeasureCodeChanged();
            }
        }
        private global::System.String _SizeUnitMeasureCode;
        partial void OnSizeUnitMeasureCodeChanging(global::System.String value);
        partial void OnSizeUnitMeasureCodeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String WeightUnitMeasureCode
        {
            get
            {
                return _WeightUnitMeasureCode;
            }
            set
            {
                OnWeightUnitMeasureCodeChanging(value);
                ReportPropertyChanging("WeightUnitMeasureCode");
                _WeightUnitMeasureCode = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("WeightUnitMeasureCode");
                OnWeightUnitMeasureCodeChanged();
            }
        }
        private global::System.String _WeightUnitMeasureCode;
        partial void OnWeightUnitMeasureCodeChanging(global::System.String value);
        partial void OnWeightUnitMeasureCodeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Decimal> Weight
        {
            get
            {
                return _Weight;
            }
            set
            {
                OnWeightChanging(value);
                ReportPropertyChanging("Weight");
                _Weight = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("Weight");
                OnWeightChanged();
            }
        }
        private Nullable<global::System.Decimal> _Weight;
        partial void OnWeightChanging(Nullable<global::System.Decimal> value);
        partial void OnWeightChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 DaysToManufacture
        {
            get
            {
                return _DaysToManufacture;
            }
            set
            {
                OnDaysToManufactureChanging(value);
                ReportPropertyChanging("DaysToManufacture");
                _DaysToManufacture = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("DaysToManufacture");
                OnDaysToManufactureChanged();
            }
        }
        private global::System.Int32 _DaysToManufacture;
        partial void OnDaysToManufactureChanging(global::System.Int32 value);
        partial void OnDaysToManufactureChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String ProductLine
        {
            get
            {
                return _ProductLine;
            }
            set
            {
                OnProductLineChanging(value);
                ReportPropertyChanging("ProductLine");
                _ProductLine = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("ProductLine");
                OnProductLineChanged();
            }
        }
        private global::System.String _ProductLine;
        partial void OnProductLineChanging(global::System.String value);
        partial void OnProductLineChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String Class
        {
            get
            {
                return _Class;
            }
            set
            {
                OnClassChanging(value);
                ReportPropertyChanging("Class");
                _Class = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("Class");
                OnClassChanged();
            }
        }
        private global::System.String _Class;
        partial void OnClassChanging(global::System.String value);
        partial void OnClassChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String Style
        {
            get
            {
                return _Style;
            }
            set
            {
                OnStyleChanging(value);
                ReportPropertyChanging("Style");
                _Style = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("Style");
                OnStyleChanged();
            }
        }
        private global::System.String _Style;
        partial void OnStyleChanging(global::System.String value);
        partial void OnStyleChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> ProductSubcategoryID
        {
            get
            {
                return _ProductSubcategoryID;
            }
            set
            {
                OnProductSubcategoryIDChanging(value);
                ReportPropertyChanging("ProductSubcategoryID");
                _ProductSubcategoryID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ProductSubcategoryID");
                OnProductSubcategoryIDChanged();
            }
        }
        private Nullable<global::System.Int32> _ProductSubcategoryID;
        partial void OnProductSubcategoryIDChanging(Nullable<global::System.Int32> value);
        partial void OnProductSubcategoryIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> ProductModelID
        {
            get
            {
                return _ProductModelID;
            }
            set
            {
                OnProductModelIDChanging(value);
                ReportPropertyChanging("ProductModelID");
                _ProductModelID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ProductModelID");
                OnProductModelIDChanged();
            }
        }
        private Nullable<global::System.Int32> _ProductModelID;
        partial void OnProductModelIDChanging(Nullable<global::System.Int32> value);
        partial void OnProductModelIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime SellStartDate
        {
            get
            {
                return _SellStartDate;
            }
            set
            {
                OnSellStartDateChanging(value);
                ReportPropertyChanging("SellStartDate");
                _SellStartDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("SellStartDate");
                OnSellStartDateChanged();
            }
        }
        private global::System.DateTime _SellStartDate;
        partial void OnSellStartDateChanging(global::System.DateTime value);
        partial void OnSellStartDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.DateTime> SellEndDate
        {
            get
            {
                return _SellEndDate;
            }
            set
            {
                OnSellEndDateChanging(value);
                ReportPropertyChanging("SellEndDate");
                _SellEndDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("SellEndDate");
                OnSellEndDateChanged();
            }
        }
        private Nullable<global::System.DateTime> _SellEndDate;
        partial void OnSellEndDateChanging(Nullable<global::System.DateTime> value);
        partial void OnSellEndDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.DateTime> DiscontinuedDate
        {
            get
            {
                return _DiscontinuedDate;
            }
            set
            {
                OnDiscontinuedDateChanging(value);
                ReportPropertyChanging("DiscontinuedDate");
                _DiscontinuedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("DiscontinuedDate");
                OnDiscontinuedDateChanged();
            }
        }
        private Nullable<global::System.DateTime> _DiscontinuedDate;
        partial void OnDiscontinuedDateChanging(Nullable<global::System.DateTime> value);
        partial void OnDiscontinuedDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Guid rowguid
        {
            get
            {
                return _rowguid;
            }
            set
            {
                OnrowguidChanging(value);
                ReportPropertyChanging("rowguid");
                _rowguid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("rowguid");
                OnrowguidChanged();
            }
        }
        private global::System.Guid _rowguid;
        partial void OnrowguidChanging(global::System.Guid value);
        partial void OnrowguidChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_BillOfMaterials_Product_ComponentID", "BillOfMaterials")]
        public EntityCollection<BillOfMaterial> BillOfMaterials
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<BillOfMaterial>("AdventureWorksModel.FK_BillOfMaterials_Product_ComponentID", "BillOfMaterials");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<BillOfMaterial>("AdventureWorksModel.FK_BillOfMaterials_Product_ComponentID", "BillOfMaterials", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_BillOfMaterials_Product_ProductAssemblyID", "BillOfMaterials")]
        public EntityCollection<BillOfMaterial> BillOfMaterials1
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<BillOfMaterial>("AdventureWorksModel.FK_BillOfMaterials_Product_ProductAssemblyID", "BillOfMaterials");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<BillOfMaterial>("AdventureWorksModel.FK_BillOfMaterials_Product_ProductAssemblyID", "BillOfMaterials", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_Product_ProductModel_ProductModelID", "ProductModel")]
        public ProductModel ProductModel
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductModel>("AdventureWorksModel.FK_Product_ProductModel_ProductModelID", "ProductModel").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductModel>("AdventureWorksModel.FK_Product_ProductModel_ProductModelID", "ProductModel").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<ProductModel> ProductModelReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductModel>("AdventureWorksModel.FK_Product_ProductModel_ProductModelID", "ProductModel");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<ProductModel>("AdventureWorksModel.FK_Product_ProductModel_ProductModelID", "ProductModel", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_Product_ProductSubcategory_ProductSubcategoryID", "ProductSubcategory")]
        public ProductSubcategory ProductSubcategory
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductSubcategory>("AdventureWorksModel.FK_Product_ProductSubcategory_ProductSubcategoryID", "ProductSubcategory").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductSubcategory>("AdventureWorksModel.FK_Product_ProductSubcategory_ProductSubcategoryID", "ProductSubcategory").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<ProductSubcategory> ProductSubcategoryReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductSubcategory>("AdventureWorksModel.FK_Product_ProductSubcategory_ProductSubcategoryID", "ProductSubcategory");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<ProductSubcategory>("AdventureWorksModel.FK_Product_ProductSubcategory_ProductSubcategoryID", "ProductSubcategory", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_Product_UnitMeasure_SizeUnitMeasureCode", "UnitMeasure")]
        public UnitMeasure UnitMeasure
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<UnitMeasure>("AdventureWorksModel.FK_Product_UnitMeasure_SizeUnitMeasureCode", "UnitMeasure").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<UnitMeasure>("AdventureWorksModel.FK_Product_UnitMeasure_SizeUnitMeasureCode", "UnitMeasure").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<UnitMeasure> UnitMeasureReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<UnitMeasure>("AdventureWorksModel.FK_Product_UnitMeasure_SizeUnitMeasureCode", "UnitMeasure");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<UnitMeasure>("AdventureWorksModel.FK_Product_UnitMeasure_SizeUnitMeasureCode", "UnitMeasure", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_Product_UnitMeasure_WeightUnitMeasureCode", "UnitMeasure")]
        public UnitMeasure UnitMeasure1
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<UnitMeasure>("AdventureWorksModel.FK_Product_UnitMeasure_WeightUnitMeasureCode", "UnitMeasure").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<UnitMeasure>("AdventureWorksModel.FK_Product_UnitMeasure_WeightUnitMeasureCode", "UnitMeasure").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<UnitMeasure> UnitMeasure1Reference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<UnitMeasure>("AdventureWorksModel.FK_Product_UnitMeasure_WeightUnitMeasureCode", "UnitMeasure");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<UnitMeasure>("AdventureWorksModel.FK_Product_UnitMeasure_WeightUnitMeasureCode", "UnitMeasure", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductCostHistory_Product_ProductID", "ProductCostHistory")]
        public EntityCollection<ProductCostHistory> ProductCostHistories
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<ProductCostHistory>("AdventureWorksModel.FK_ProductCostHistory_Product_ProductID", "ProductCostHistory");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<ProductCostHistory>("AdventureWorksModel.FK_ProductCostHistory_Product_ProductID", "ProductCostHistory", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductDocument_Product_ProductID", "ProductDocument")]
        public EntityCollection<ProductDocument> ProductDocuments
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<ProductDocument>("AdventureWorksModel.FK_ProductDocument_Product_ProductID", "ProductDocument");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<ProductDocument>("AdventureWorksModel.FK_ProductDocument_Product_ProductID", "ProductDocument", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductInventory_Product_ProductID", "ProductInventory")]
        public EntityCollection<ProductInventory> ProductInventories
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<ProductInventory>("AdventureWorksModel.FK_ProductInventory_Product_ProductID", "ProductInventory");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<ProductInventory>("AdventureWorksModel.FK_ProductInventory_Product_ProductID", "ProductInventory", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductListPriceHistory_Product_ProductID", "ProductListPriceHistory")]
        public EntityCollection<ProductListPriceHistory> ProductListPriceHistories
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<ProductListPriceHistory>("AdventureWorksModel.FK_ProductListPriceHistory_Product_ProductID", "ProductListPriceHistory");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<ProductListPriceHistory>("AdventureWorksModel.FK_ProductListPriceHistory_Product_ProductID", "ProductListPriceHistory", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductProductPhoto_Product_ProductID", "ProductProductPhoto")]
        public EntityCollection<ProductProductPhoto> ProductProductPhotoes
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<ProductProductPhoto>("AdventureWorksModel.FK_ProductProductPhoto_Product_ProductID", "ProductProductPhoto");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<ProductProductPhoto>("AdventureWorksModel.FK_ProductProductPhoto_Product_ProductID", "ProductProductPhoto", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductReview_Product_ProductID", "ProductReview")]
        public EntityCollection<ProductReview> ProductReviews
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<ProductReview>("AdventureWorksModel.FK_ProductReview_Product_ProductID", "ProductReview");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<ProductReview>("AdventureWorksModel.FK_ProductReview_Product_ProductID", "ProductReview", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductVendor_Product_ProductID", "ProductVendor")]
        public EntityCollection<ProductVendor> ProductVendors
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<ProductVendor>("AdventureWorksModel.FK_ProductVendor_Product_ProductID", "ProductVendor");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<ProductVendor>("AdventureWorksModel.FK_ProductVendor_Product_ProductID", "ProductVendor", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_PurchaseOrderDetail_Product_ProductID", "PurchaseOrderDetail")]
        public EntityCollection<PurchaseOrderDetail> PurchaseOrderDetails
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<PurchaseOrderDetail>("AdventureWorksModel.FK_PurchaseOrderDetail_Product_ProductID", "PurchaseOrderDetail");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<PurchaseOrderDetail>("AdventureWorksModel.FK_PurchaseOrderDetail_Product_ProductID", "PurchaseOrderDetail", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ShoppingCartItem_Product_ProductID", "ShoppingCartItem")]
        public EntityCollection<ShoppingCartItem> ShoppingCartItems
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<ShoppingCartItem>("AdventureWorksModel.FK_ShoppingCartItem_Product_ProductID", "ShoppingCartItem");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<ShoppingCartItem>("AdventureWorksModel.FK_ShoppingCartItem_Product_ProductID", "ShoppingCartItem", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SpecialOfferProduct_Product_ProductID", "SpecialOfferProduct")]
        public EntityCollection<SpecialOfferProduct> SpecialOfferProducts
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<SpecialOfferProduct>("AdventureWorksModel.FK_SpecialOfferProduct_Product_ProductID", "SpecialOfferProduct");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<SpecialOfferProduct>("AdventureWorksModel.FK_SpecialOfferProduct_Product_ProductID", "SpecialOfferProduct", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_TransactionHistory_Product_ProductID", "TransactionHistory")]
        public EntityCollection<TransactionHistory> TransactionHistories
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<TransactionHistory>("AdventureWorksModel.FK_TransactionHistory_Product_ProductID", "TransactionHistory");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<TransactionHistory>("AdventureWorksModel.FK_TransactionHistory_Product_ProductID", "TransactionHistory", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_WorkOrder_Product_ProductID", "WorkOrder")]
        public EntityCollection<WorkOrder> WorkOrders
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<WorkOrder>("AdventureWorksModel.FK_WorkOrder_Product_ProductID", "WorkOrder");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<WorkOrder>("AdventureWorksModel.FK_WorkOrder_Product_ProductID", "WorkOrder", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="ProductCategory")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class ProductCategory : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new ProductCategory object.
        /// </summary>
        /// <param name="productCategoryID">Initial value of the ProductCategoryID property.</param>
        /// <param name="name">Initial value of the Name property.</param>
        /// <param name="rowguid">Initial value of the rowguid property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static ProductCategory CreateProductCategory(global::System.Int32 productCategoryID, global::System.String name, global::System.Guid rowguid, global::System.DateTime modifiedDate)
        {
            ProductCategory productCategory = new ProductCategory();
            productCategory.ProductCategoryID = productCategoryID;
            productCategory.Name = name;
            productCategory.rowguid = rowguid;
            productCategory.ModifiedDate = modifiedDate;
            return productCategory;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ProductCategoryID
        {
            get
            {
                return _ProductCategoryID;
            }
            set
            {
                if (_ProductCategoryID != value)
                {
                    OnProductCategoryIDChanging(value);
                    ReportPropertyChanging("ProductCategoryID");
                    _ProductCategoryID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ProductCategoryID");
                    OnProductCategoryIDChanged();
                }
            }
        }
        private global::System.Int32 _ProductCategoryID;
        partial void OnProductCategoryIDChanging(global::System.Int32 value);
        partial void OnProductCategoryIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Name
        {
            get
            {
                return _Name;
            }
            set
            {
                OnNameChanging(value);
                ReportPropertyChanging("Name");
                _Name = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Name");
                OnNameChanged();
            }
        }
        private global::System.String _Name;
        partial void OnNameChanging(global::System.String value);
        partial void OnNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Guid rowguid
        {
            get
            {
                return _rowguid;
            }
            set
            {
                OnrowguidChanging(value);
                ReportPropertyChanging("rowguid");
                _rowguid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("rowguid");
                OnrowguidChanged();
            }
        }
        private global::System.Guid _rowguid;
        partial void OnrowguidChanging(global::System.Guid value);
        partial void OnrowguidChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductSubcategory_ProductCategory_ProductCategoryID", "ProductSubcategory")]
        public EntityCollection<ProductSubcategory> ProductSubcategories
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<ProductSubcategory>("AdventureWorksModel.FK_ProductSubcategory_ProductCategory_ProductCategoryID", "ProductSubcategory");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<ProductSubcategory>("AdventureWorksModel.FK_ProductSubcategory_ProductCategory_ProductCategoryID", "ProductSubcategory", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="ProductCostHistory")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class ProductCostHistory : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new ProductCostHistory object.
        /// </summary>
        /// <param name="productID">Initial value of the ProductID property.</param>
        /// <param name="startDate">Initial value of the StartDate property.</param>
        /// <param name="standardCost">Initial value of the StandardCost property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static ProductCostHistory CreateProductCostHistory(global::System.Int32 productID, global::System.DateTime startDate, global::System.Decimal standardCost, global::System.DateTime modifiedDate)
        {
            ProductCostHistory productCostHistory = new ProductCostHistory();
            productCostHistory.ProductID = productID;
            productCostHistory.StartDate = startDate;
            productCostHistory.StandardCost = standardCost;
            productCostHistory.ModifiedDate = modifiedDate;
            return productCostHistory;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ProductID
        {
            get
            {
                return _ProductID;
            }
            set
            {
                if (_ProductID != value)
                {
                    OnProductIDChanging(value);
                    ReportPropertyChanging("ProductID");
                    _ProductID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ProductID");
                    OnProductIDChanged();
                }
            }
        }
        private global::System.Int32 _ProductID;
        partial void OnProductIDChanging(global::System.Int32 value);
        partial void OnProductIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime StartDate
        {
            get
            {
                return _StartDate;
            }
            set
            {
                if (_StartDate != value)
                {
                    OnStartDateChanging(value);
                    ReportPropertyChanging("StartDate");
                    _StartDate = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("StartDate");
                    OnStartDateChanged();
                }
            }
        }
        private global::System.DateTime _StartDate;
        partial void OnStartDateChanging(global::System.DateTime value);
        partial void OnStartDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.DateTime> EndDate
        {
            get
            {
                return _EndDate;
            }
            set
            {
                OnEndDateChanging(value);
                ReportPropertyChanging("EndDate");
                _EndDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("EndDate");
                OnEndDateChanged();
            }
        }
        private Nullable<global::System.DateTime> _EndDate;
        partial void OnEndDateChanging(Nullable<global::System.DateTime> value);
        partial void OnEndDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal StandardCost
        {
            get
            {
                return _StandardCost;
            }
            set
            {
                OnStandardCostChanging(value);
                ReportPropertyChanging("StandardCost");
                _StandardCost = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("StandardCost");
                OnStandardCostChanged();
            }
        }
        private global::System.Decimal _StandardCost;
        partial void OnStandardCostChanging(global::System.Decimal value);
        partial void OnStandardCostChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductCostHistory_Product_ProductID", "Product")]
        public Product Product
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_ProductCostHistory_Product_ProductID", "Product").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_ProductCostHistory_Product_ProductID", "Product").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Product> ProductReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_ProductCostHistory_Product_ProductID", "Product");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Product>("AdventureWorksModel.FK_ProductCostHistory_Product_ProductID", "Product", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="ProductDescription")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class ProductDescription : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new ProductDescription object.
        /// </summary>
        /// <param name="productDescriptionID">Initial value of the ProductDescriptionID property.</param>
        /// <param name="description">Initial value of the Description property.</param>
        /// <param name="rowguid">Initial value of the rowguid property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static ProductDescription CreateProductDescription(global::System.Int32 productDescriptionID, global::System.String description, global::System.Guid rowguid, global::System.DateTime modifiedDate)
        {
            ProductDescription productDescription = new ProductDescription();
            productDescription.ProductDescriptionID = productDescriptionID;
            productDescription.Description = description;
            productDescription.rowguid = rowguid;
            productDescription.ModifiedDate = modifiedDate;
            return productDescription;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ProductDescriptionID
        {
            get
            {
                return _ProductDescriptionID;
            }
            set
            {
                if (_ProductDescriptionID != value)
                {
                    OnProductDescriptionIDChanging(value);
                    ReportPropertyChanging("ProductDescriptionID");
                    _ProductDescriptionID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ProductDescriptionID");
                    OnProductDescriptionIDChanged();
                }
            }
        }
        private global::System.Int32 _ProductDescriptionID;
        partial void OnProductDescriptionIDChanging(global::System.Int32 value);
        partial void OnProductDescriptionIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Description
        {
            get
            {
                return _Description;
            }
            set
            {
                OnDescriptionChanging(value);
                ReportPropertyChanging("Description");
                _Description = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Description");
                OnDescriptionChanged();
            }
        }
        private global::System.String _Description;
        partial void OnDescriptionChanging(global::System.String value);
        partial void OnDescriptionChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Guid rowguid
        {
            get
            {
                return _rowguid;
            }
            set
            {
                OnrowguidChanging(value);
                ReportPropertyChanging("rowguid");
                _rowguid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("rowguid");
                OnrowguidChanged();
            }
        }
        private global::System.Guid _rowguid;
        partial void OnrowguidChanging(global::System.Guid value);
        partial void OnrowguidChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID", "ProductModelProductDescriptionCulture")]
        public EntityCollection<ProductModelProductDescriptionCulture> ProductModelProductDescriptionCultures
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<ProductModelProductDescriptionCulture>("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID", "ProductModelProductDescriptionCulture");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<ProductModelProductDescriptionCulture>("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID", "ProductModelProductDescriptionCulture", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="ProductDocument")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class ProductDocument : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new ProductDocument object.
        /// </summary>
        /// <param name="productID">Initial value of the ProductID property.</param>
        /// <param name="documentID">Initial value of the DocumentID property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static ProductDocument CreateProductDocument(global::System.Int32 productID, global::System.Int32 documentID, global::System.DateTime modifiedDate)
        {
            ProductDocument productDocument = new ProductDocument();
            productDocument.ProductID = productID;
            productDocument.DocumentID = documentID;
            productDocument.ModifiedDate = modifiedDate;
            return productDocument;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ProductID
        {
            get
            {
                return _ProductID;
            }
            set
            {
                if (_ProductID != value)
                {
                    OnProductIDChanging(value);
                    ReportPropertyChanging("ProductID");
                    _ProductID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ProductID");
                    OnProductIDChanged();
                }
            }
        }
        private global::System.Int32 _ProductID;
        partial void OnProductIDChanging(global::System.Int32 value);
        partial void OnProductIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 DocumentID
        {
            get
            {
                return _DocumentID;
            }
            set
            {
                if (_DocumentID != value)
                {
                    OnDocumentIDChanging(value);
                    ReportPropertyChanging("DocumentID");
                    _DocumentID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("DocumentID");
                    OnDocumentIDChanged();
                }
            }
        }
        private global::System.Int32 _DocumentID;
        partial void OnDocumentIDChanging(global::System.Int32 value);
        partial void OnDocumentIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductDocument_Document_DocumentID", "Document")]
        public Document Document
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Document>("AdventureWorksModel.FK_ProductDocument_Document_DocumentID", "Document").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Document>("AdventureWorksModel.FK_ProductDocument_Document_DocumentID", "Document").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Document> DocumentReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Document>("AdventureWorksModel.FK_ProductDocument_Document_DocumentID", "Document");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Document>("AdventureWorksModel.FK_ProductDocument_Document_DocumentID", "Document", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductDocument_Product_ProductID", "Product")]
        public Product Product
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_ProductDocument_Product_ProductID", "Product").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_ProductDocument_Product_ProductID", "Product").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Product> ProductReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_ProductDocument_Product_ProductID", "Product");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Product>("AdventureWorksModel.FK_ProductDocument_Product_ProductID", "Product", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="ProductInventory")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class ProductInventory : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new ProductInventory object.
        /// </summary>
        /// <param name="productID">Initial value of the ProductID property.</param>
        /// <param name="locationID">Initial value of the LocationID property.</param>
        /// <param name="shelf">Initial value of the Shelf property.</param>
        /// <param name="bin">Initial value of the Bin property.</param>
        /// <param name="quantity">Initial value of the Quantity property.</param>
        /// <param name="rowguid">Initial value of the rowguid property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static ProductInventory CreateProductInventory(global::System.Int32 productID, global::System.Int16 locationID, global::System.String shelf, global::System.Byte bin, global::System.Int16 quantity, global::System.Guid rowguid, global::System.DateTime modifiedDate)
        {
            ProductInventory productInventory = new ProductInventory();
            productInventory.ProductID = productID;
            productInventory.LocationID = locationID;
            productInventory.Shelf = shelf;
            productInventory.Bin = bin;
            productInventory.Quantity = quantity;
            productInventory.rowguid = rowguid;
            productInventory.ModifiedDate = modifiedDate;
            return productInventory;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ProductID
        {
            get
            {
                return _ProductID;
            }
            set
            {
                if (_ProductID != value)
                {
                    OnProductIDChanging(value);
                    ReportPropertyChanging("ProductID");
                    _ProductID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ProductID");
                    OnProductIDChanged();
                }
            }
        }
        private global::System.Int32 _ProductID;
        partial void OnProductIDChanging(global::System.Int32 value);
        partial void OnProductIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int16 LocationID
        {
            get
            {
                return _LocationID;
            }
            set
            {
                if (_LocationID != value)
                {
                    OnLocationIDChanging(value);
                    ReportPropertyChanging("LocationID");
                    _LocationID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("LocationID");
                    OnLocationIDChanged();
                }
            }
        }
        private global::System.Int16 _LocationID;
        partial void OnLocationIDChanging(global::System.Int16 value);
        partial void OnLocationIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Shelf
        {
            get
            {
                return _Shelf;
            }
            set
            {
                OnShelfChanging(value);
                ReportPropertyChanging("Shelf");
                _Shelf = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Shelf");
                OnShelfChanged();
            }
        }
        private global::System.String _Shelf;
        partial void OnShelfChanging(global::System.String value);
        partial void OnShelfChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Byte Bin
        {
            get
            {
                return _Bin;
            }
            set
            {
                OnBinChanging(value);
                ReportPropertyChanging("Bin");
                _Bin = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("Bin");
                OnBinChanged();
            }
        }
        private global::System.Byte _Bin;
        partial void OnBinChanging(global::System.Byte value);
        partial void OnBinChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int16 Quantity
        {
            get
            {
                return _Quantity;
            }
            set
            {
                OnQuantityChanging(value);
                ReportPropertyChanging("Quantity");
                _Quantity = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("Quantity");
                OnQuantityChanged();
            }
        }
        private global::System.Int16 _Quantity;
        partial void OnQuantityChanging(global::System.Int16 value);
        partial void OnQuantityChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Guid rowguid
        {
            get
            {
                return _rowguid;
            }
            set
            {
                OnrowguidChanging(value);
                ReportPropertyChanging("rowguid");
                _rowguid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("rowguid");
                OnrowguidChanged();
            }
        }
        private global::System.Guid _rowguid;
        partial void OnrowguidChanging(global::System.Guid value);
        partial void OnrowguidChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductInventory_Location_LocationID", "Location")]
        public Location Location
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Location>("AdventureWorksModel.FK_ProductInventory_Location_LocationID", "Location").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Location>("AdventureWorksModel.FK_ProductInventory_Location_LocationID", "Location").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Location> LocationReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Location>("AdventureWorksModel.FK_ProductInventory_Location_LocationID", "Location");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Location>("AdventureWorksModel.FK_ProductInventory_Location_LocationID", "Location", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductInventory_Product_ProductID", "Product")]
        public Product Product
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_ProductInventory_Product_ProductID", "Product").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_ProductInventory_Product_ProductID", "Product").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Product> ProductReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_ProductInventory_Product_ProductID", "Product");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Product>("AdventureWorksModel.FK_ProductInventory_Product_ProductID", "Product", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="ProductListPriceHistory")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class ProductListPriceHistory : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new ProductListPriceHistory object.
        /// </summary>
        /// <param name="productID">Initial value of the ProductID property.</param>
        /// <param name="startDate">Initial value of the StartDate property.</param>
        /// <param name="listPrice">Initial value of the ListPrice property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static ProductListPriceHistory CreateProductListPriceHistory(global::System.Int32 productID, global::System.DateTime startDate, global::System.Decimal listPrice, global::System.DateTime modifiedDate)
        {
            ProductListPriceHistory productListPriceHistory = new ProductListPriceHistory();
            productListPriceHistory.ProductID = productID;
            productListPriceHistory.StartDate = startDate;
            productListPriceHistory.ListPrice = listPrice;
            productListPriceHistory.ModifiedDate = modifiedDate;
            return productListPriceHistory;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ProductID
        {
            get
            {
                return _ProductID;
            }
            set
            {
                if (_ProductID != value)
                {
                    OnProductIDChanging(value);
                    ReportPropertyChanging("ProductID");
                    _ProductID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ProductID");
                    OnProductIDChanged();
                }
            }
        }
        private global::System.Int32 _ProductID;
        partial void OnProductIDChanging(global::System.Int32 value);
        partial void OnProductIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime StartDate
        {
            get
            {
                return _StartDate;
            }
            set
            {
                if (_StartDate != value)
                {
                    OnStartDateChanging(value);
                    ReportPropertyChanging("StartDate");
                    _StartDate = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("StartDate");
                    OnStartDateChanged();
                }
            }
        }
        private global::System.DateTime _StartDate;
        partial void OnStartDateChanging(global::System.DateTime value);
        partial void OnStartDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.DateTime> EndDate
        {
            get
            {
                return _EndDate;
            }
            set
            {
                OnEndDateChanging(value);
                ReportPropertyChanging("EndDate");
                _EndDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("EndDate");
                OnEndDateChanged();
            }
        }
        private Nullable<global::System.DateTime> _EndDate;
        partial void OnEndDateChanging(Nullable<global::System.DateTime> value);
        partial void OnEndDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal ListPrice
        {
            get
            {
                return _ListPrice;
            }
            set
            {
                OnListPriceChanging(value);
                ReportPropertyChanging("ListPrice");
                _ListPrice = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ListPrice");
                OnListPriceChanged();
            }
        }
        private global::System.Decimal _ListPrice;
        partial void OnListPriceChanging(global::System.Decimal value);
        partial void OnListPriceChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductListPriceHistory_Product_ProductID", "Product")]
        public Product Product
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_ProductListPriceHistory_Product_ProductID", "Product").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_ProductListPriceHistory_Product_ProductID", "Product").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Product> ProductReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_ProductListPriceHistory_Product_ProductID", "Product");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Product>("AdventureWorksModel.FK_ProductListPriceHistory_Product_ProductID", "Product", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="ProductModel")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class ProductModel : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new ProductModel object.
        /// </summary>
        /// <param name="productModelID">Initial value of the ProductModelID property.</param>
        /// <param name="name">Initial value of the Name property.</param>
        /// <param name="rowguid">Initial value of the rowguid property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static ProductModel CreateProductModel(global::System.Int32 productModelID, global::System.String name, global::System.Guid rowguid, global::System.DateTime modifiedDate)
        {
            ProductModel productModel = new ProductModel();
            productModel.ProductModelID = productModelID;
            productModel.Name = name;
            productModel.rowguid = rowguid;
            productModel.ModifiedDate = modifiedDate;
            return productModel;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ProductModelID
        {
            get
            {
                return _ProductModelID;
            }
            set
            {
                if (_ProductModelID != value)
                {
                    OnProductModelIDChanging(value);
                    ReportPropertyChanging("ProductModelID");
                    _ProductModelID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ProductModelID");
                    OnProductModelIDChanged();
                }
            }
        }
        private global::System.Int32 _ProductModelID;
        partial void OnProductModelIDChanging(global::System.Int32 value);
        partial void OnProductModelIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Name
        {
            get
            {
                return _Name;
            }
            set
            {
                OnNameChanging(value);
                ReportPropertyChanging("Name");
                _Name = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Name");
                OnNameChanged();
            }
        }
        private global::System.String _Name;
        partial void OnNameChanging(global::System.String value);
        partial void OnNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String CatalogDescription
        {
            get
            {
                return _CatalogDescription;
            }
            set
            {
                OnCatalogDescriptionChanging(value);
                ReportPropertyChanging("CatalogDescription");
                _CatalogDescription = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("CatalogDescription");
                OnCatalogDescriptionChanged();
            }
        }
        private global::System.String _CatalogDescription;
        partial void OnCatalogDescriptionChanging(global::System.String value);
        partial void OnCatalogDescriptionChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String Instructions
        {
            get
            {
                return _Instructions;
            }
            set
            {
                OnInstructionsChanging(value);
                ReportPropertyChanging("Instructions");
                _Instructions = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("Instructions");
                OnInstructionsChanged();
            }
        }
        private global::System.String _Instructions;
        partial void OnInstructionsChanging(global::System.String value);
        partial void OnInstructionsChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Guid rowguid
        {
            get
            {
                return _rowguid;
            }
            set
            {
                OnrowguidChanging(value);
                ReportPropertyChanging("rowguid");
                _rowguid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("rowguid");
                OnrowguidChanged();
            }
        }
        private global::System.Guid _rowguid;
        partial void OnrowguidChanging(global::System.Guid value);
        partial void OnrowguidChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_Product_ProductModel_ProductModelID", "Product")]
        public EntityCollection<Product> Products
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<Product>("AdventureWorksModel.FK_Product_ProductModel_ProductModelID", "Product");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<Product>("AdventureWorksModel.FK_Product_ProductModel_ProductModelID", "Product", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductModelIllustration_ProductModel_ProductModelID", "ProductModelIllustration")]
        public EntityCollection<ProductModelIllustration> ProductModelIllustrations
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<ProductModelIllustration>("AdventureWorksModel.FK_ProductModelIllustration_ProductModel_ProductModelID", "ProductModelIllustration");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<ProductModelIllustration>("AdventureWorksModel.FK_ProductModelIllustration_ProductModel_ProductModelID", "ProductModelIllustration", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID", "ProductModelProductDescriptionCulture")]
        public EntityCollection<ProductModelProductDescriptionCulture> ProductModelProductDescriptionCultures
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<ProductModelProductDescriptionCulture>("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID", "ProductModelProductDescriptionCulture");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<ProductModelProductDescriptionCulture>("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID", "ProductModelProductDescriptionCulture", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="ProductModelIllustration")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class ProductModelIllustration : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new ProductModelIllustration object.
        /// </summary>
        /// <param name="productModelID">Initial value of the ProductModelID property.</param>
        /// <param name="illustrationID">Initial value of the IllustrationID property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static ProductModelIllustration CreateProductModelIllustration(global::System.Int32 productModelID, global::System.Int32 illustrationID, global::System.DateTime modifiedDate)
        {
            ProductModelIllustration productModelIllustration = new ProductModelIllustration();
            productModelIllustration.ProductModelID = productModelID;
            productModelIllustration.IllustrationID = illustrationID;
            productModelIllustration.ModifiedDate = modifiedDate;
            return productModelIllustration;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ProductModelID
        {
            get
            {
                return _ProductModelID;
            }
            set
            {
                if (_ProductModelID != value)
                {
                    OnProductModelIDChanging(value);
                    ReportPropertyChanging("ProductModelID");
                    _ProductModelID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ProductModelID");
                    OnProductModelIDChanged();
                }
            }
        }
        private global::System.Int32 _ProductModelID;
        partial void OnProductModelIDChanging(global::System.Int32 value);
        partial void OnProductModelIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 IllustrationID
        {
            get
            {
                return _IllustrationID;
            }
            set
            {
                if (_IllustrationID != value)
                {
                    OnIllustrationIDChanging(value);
                    ReportPropertyChanging("IllustrationID");
                    _IllustrationID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("IllustrationID");
                    OnIllustrationIDChanged();
                }
            }
        }
        private global::System.Int32 _IllustrationID;
        partial void OnIllustrationIDChanging(global::System.Int32 value);
        partial void OnIllustrationIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductModelIllustration_Illustration_IllustrationID", "Illustration")]
        public Illustration Illustration
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Illustration>("AdventureWorksModel.FK_ProductModelIllustration_Illustration_IllustrationID", "Illustration").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Illustration>("AdventureWorksModel.FK_ProductModelIllustration_Illustration_IllustrationID", "Illustration").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Illustration> IllustrationReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Illustration>("AdventureWorksModel.FK_ProductModelIllustration_Illustration_IllustrationID", "Illustration");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Illustration>("AdventureWorksModel.FK_ProductModelIllustration_Illustration_IllustrationID", "Illustration", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductModelIllustration_ProductModel_ProductModelID", "ProductModel")]
        public ProductModel ProductModel
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductModel>("AdventureWorksModel.FK_ProductModelIllustration_ProductModel_ProductModelID", "ProductModel").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductModel>("AdventureWorksModel.FK_ProductModelIllustration_ProductModel_ProductModelID", "ProductModel").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<ProductModel> ProductModelReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductModel>("AdventureWorksModel.FK_ProductModelIllustration_ProductModel_ProductModelID", "ProductModel");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<ProductModel>("AdventureWorksModel.FK_ProductModelIllustration_ProductModel_ProductModelID", "ProductModel", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="ProductModelProductDescriptionCulture")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class ProductModelProductDescriptionCulture : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new ProductModelProductDescriptionCulture object.
        /// </summary>
        /// <param name="productModelID">Initial value of the ProductModelID property.</param>
        /// <param name="productDescriptionID">Initial value of the ProductDescriptionID property.</param>
        /// <param name="cultureID">Initial value of the CultureID property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static ProductModelProductDescriptionCulture CreateProductModelProductDescriptionCulture(global::System.Int32 productModelID, global::System.Int32 productDescriptionID, global::System.String cultureID, global::System.DateTime modifiedDate)
        {
            ProductModelProductDescriptionCulture productModelProductDescriptionCulture = new ProductModelProductDescriptionCulture();
            productModelProductDescriptionCulture.ProductModelID = productModelID;
            productModelProductDescriptionCulture.ProductDescriptionID = productDescriptionID;
            productModelProductDescriptionCulture.CultureID = cultureID;
            productModelProductDescriptionCulture.ModifiedDate = modifiedDate;
            return productModelProductDescriptionCulture;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ProductModelID
        {
            get
            {
                return _ProductModelID;
            }
            set
            {
                if (_ProductModelID != value)
                {
                    OnProductModelIDChanging(value);
                    ReportPropertyChanging("ProductModelID");
                    _ProductModelID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ProductModelID");
                    OnProductModelIDChanged();
                }
            }
        }
        private global::System.Int32 _ProductModelID;
        partial void OnProductModelIDChanging(global::System.Int32 value);
        partial void OnProductModelIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ProductDescriptionID
        {
            get
            {
                return _ProductDescriptionID;
            }
            set
            {
                if (_ProductDescriptionID != value)
                {
                    OnProductDescriptionIDChanging(value);
                    ReportPropertyChanging("ProductDescriptionID");
                    _ProductDescriptionID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ProductDescriptionID");
                    OnProductDescriptionIDChanged();
                }
            }
        }
        private global::System.Int32 _ProductDescriptionID;
        partial void OnProductDescriptionIDChanging(global::System.Int32 value);
        partial void OnProductDescriptionIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String CultureID
        {
            get
            {
                return _CultureID;
            }
            set
            {
                if (_CultureID != value)
                {
                    OnCultureIDChanging(value);
                    ReportPropertyChanging("CultureID");
                    _CultureID = StructuralObject.SetValidValue(value, false);
                    ReportPropertyChanged("CultureID");
                    OnCultureIDChanged();
                }
            }
        }
        private global::System.String _CultureID;
        partial void OnCultureIDChanging(global::System.String value);
        partial void OnCultureIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductModelProductDescriptionCulture_Culture_CultureID", "Culture")]
        public Culture Culture
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Culture>("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_Culture_CultureID", "Culture").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Culture>("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_Culture_CultureID", "Culture").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Culture> CultureReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Culture>("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_Culture_CultureID", "Culture");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Culture>("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_Culture_CultureID", "Culture", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID", "ProductDescription")]
        public ProductDescription ProductDescription
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductDescription>("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID", "ProductDescription").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductDescription>("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID", "ProductDescription").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<ProductDescription> ProductDescriptionReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductDescription>("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID", "ProductDescription");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<ProductDescription>("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID", "ProductDescription", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID", "ProductModel")]
        public ProductModel ProductModel
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductModel>("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID", "ProductModel").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductModel>("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID", "ProductModel").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<ProductModel> ProductModelReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductModel>("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID", "ProductModel");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<ProductModel>("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID", "ProductModel", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="ProductPhoto")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class ProductPhoto : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new ProductPhoto object.
        /// </summary>
        /// <param name="productPhotoID">Initial value of the ProductPhotoID property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static ProductPhoto CreateProductPhoto(global::System.Int32 productPhotoID, global::System.DateTime modifiedDate)
        {
            ProductPhoto productPhoto = new ProductPhoto();
            productPhoto.ProductPhotoID = productPhotoID;
            productPhoto.ModifiedDate = modifiedDate;
            return productPhoto;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ProductPhotoID
        {
            get
            {
                return _ProductPhotoID;
            }
            set
            {
                if (_ProductPhotoID != value)
                {
                    OnProductPhotoIDChanging(value);
                    ReportPropertyChanging("ProductPhotoID");
                    _ProductPhotoID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ProductPhotoID");
                    OnProductPhotoIDChanged();
                }
            }
        }
        private global::System.Int32 _ProductPhotoID;
        partial void OnProductPhotoIDChanging(global::System.Int32 value);
        partial void OnProductPhotoIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.Byte[] ThumbNailPhoto
        {
            get
            {
                return StructuralObject.GetValidValue(_ThumbNailPhoto);
            }
            set
            {
                OnThumbNailPhotoChanging(value);
                ReportPropertyChanging("ThumbNailPhoto");
                _ThumbNailPhoto = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("ThumbNailPhoto");
                OnThumbNailPhotoChanged();
            }
        }
        private global::System.Byte[] _ThumbNailPhoto;
        partial void OnThumbNailPhotoChanging(global::System.Byte[] value);
        partial void OnThumbNailPhotoChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String ThumbnailPhotoFileName
        {
            get
            {
                return _ThumbnailPhotoFileName;
            }
            set
            {
                OnThumbnailPhotoFileNameChanging(value);
                ReportPropertyChanging("ThumbnailPhotoFileName");
                _ThumbnailPhotoFileName = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("ThumbnailPhotoFileName");
                OnThumbnailPhotoFileNameChanged();
            }
        }
        private global::System.String _ThumbnailPhotoFileName;
        partial void OnThumbnailPhotoFileNameChanging(global::System.String value);
        partial void OnThumbnailPhotoFileNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.Byte[] LargePhoto
        {
            get
            {
                return StructuralObject.GetValidValue(_LargePhoto);
            }
            set
            {
                OnLargePhotoChanging(value);
                ReportPropertyChanging("LargePhoto");
                _LargePhoto = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("LargePhoto");
                OnLargePhotoChanged();
            }
        }
        private global::System.Byte[] _LargePhoto;
        partial void OnLargePhotoChanging(global::System.Byte[] value);
        partial void OnLargePhotoChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String LargePhotoFileName
        {
            get
            {
                return _LargePhotoFileName;
            }
            set
            {
                OnLargePhotoFileNameChanging(value);
                ReportPropertyChanging("LargePhotoFileName");
                _LargePhotoFileName = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("LargePhotoFileName");
                OnLargePhotoFileNameChanged();
            }
        }
        private global::System.String _LargePhotoFileName;
        partial void OnLargePhotoFileNameChanging(global::System.String value);
        partial void OnLargePhotoFileNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductProductPhoto_ProductPhoto_ProductPhotoID", "ProductProductPhoto")]
        public EntityCollection<ProductProductPhoto> ProductProductPhotoes
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<ProductProductPhoto>("AdventureWorksModel.FK_ProductProductPhoto_ProductPhoto_ProductPhotoID", "ProductProductPhoto");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<ProductProductPhoto>("AdventureWorksModel.FK_ProductProductPhoto_ProductPhoto_ProductPhotoID", "ProductProductPhoto", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="ProductProductPhoto")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class ProductProductPhoto : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new ProductProductPhoto object.
        /// </summary>
        /// <param name="productID">Initial value of the ProductID property.</param>
        /// <param name="productPhotoID">Initial value of the ProductPhotoID property.</param>
        /// <param name="primary">Initial value of the Primary property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static ProductProductPhoto CreateProductProductPhoto(global::System.Int32 productID, global::System.Int32 productPhotoID, global::System.Boolean primary, global::System.DateTime modifiedDate)
        {
            ProductProductPhoto productProductPhoto = new ProductProductPhoto();
            productProductPhoto.ProductID = productID;
            productProductPhoto.ProductPhotoID = productPhotoID;
            productProductPhoto.Primary = primary;
            productProductPhoto.ModifiedDate = modifiedDate;
            return productProductPhoto;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ProductID
        {
            get
            {
                return _ProductID;
            }
            set
            {
                if (_ProductID != value)
                {
                    OnProductIDChanging(value);
                    ReportPropertyChanging("ProductID");
                    _ProductID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ProductID");
                    OnProductIDChanged();
                }
            }
        }
        private global::System.Int32 _ProductID;
        partial void OnProductIDChanging(global::System.Int32 value);
        partial void OnProductIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ProductPhotoID
        {
            get
            {
                return _ProductPhotoID;
            }
            set
            {
                if (_ProductPhotoID != value)
                {
                    OnProductPhotoIDChanging(value);
                    ReportPropertyChanging("ProductPhotoID");
                    _ProductPhotoID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ProductPhotoID");
                    OnProductPhotoIDChanged();
                }
            }
        }
        private global::System.Int32 _ProductPhotoID;
        partial void OnProductPhotoIDChanging(global::System.Int32 value);
        partial void OnProductPhotoIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Boolean Primary
        {
            get
            {
                return _Primary;
            }
            set
            {
                OnPrimaryChanging(value);
                ReportPropertyChanging("Primary");
                _Primary = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("Primary");
                OnPrimaryChanged();
            }
        }
        private global::System.Boolean _Primary;
        partial void OnPrimaryChanging(global::System.Boolean value);
        partial void OnPrimaryChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductProductPhoto_Product_ProductID", "Product")]
        public Product Product
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_ProductProductPhoto_Product_ProductID", "Product").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_ProductProductPhoto_Product_ProductID", "Product").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Product> ProductReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_ProductProductPhoto_Product_ProductID", "Product");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Product>("AdventureWorksModel.FK_ProductProductPhoto_Product_ProductID", "Product", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductProductPhoto_ProductPhoto_ProductPhotoID", "ProductPhoto")]
        public ProductPhoto ProductPhoto
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductPhoto>("AdventureWorksModel.FK_ProductProductPhoto_ProductPhoto_ProductPhotoID", "ProductPhoto").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductPhoto>("AdventureWorksModel.FK_ProductProductPhoto_ProductPhoto_ProductPhotoID", "ProductPhoto").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<ProductPhoto> ProductPhotoReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductPhoto>("AdventureWorksModel.FK_ProductProductPhoto_ProductPhoto_ProductPhotoID", "ProductPhoto");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<ProductPhoto>("AdventureWorksModel.FK_ProductProductPhoto_ProductPhoto_ProductPhotoID", "ProductPhoto", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="ProductReview")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class ProductReview : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new ProductReview object.
        /// </summary>
        /// <param name="productReviewID">Initial value of the ProductReviewID property.</param>
        /// <param name="productID">Initial value of the ProductID property.</param>
        /// <param name="reviewerName">Initial value of the ReviewerName property.</param>
        /// <param name="reviewDate">Initial value of the ReviewDate property.</param>
        /// <param name="emailAddress">Initial value of the EmailAddress property.</param>
        /// <param name="rating">Initial value of the Rating property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static ProductReview CreateProductReview(global::System.Int32 productReviewID, global::System.Int32 productID, global::System.String reviewerName, global::System.DateTime reviewDate, global::System.String emailAddress, global::System.Int32 rating, global::System.DateTime modifiedDate)
        {
            ProductReview productReview = new ProductReview();
            productReview.ProductReviewID = productReviewID;
            productReview.ProductID = productID;
            productReview.ReviewerName = reviewerName;
            productReview.ReviewDate = reviewDate;
            productReview.EmailAddress = emailAddress;
            productReview.Rating = rating;
            productReview.ModifiedDate = modifiedDate;
            return productReview;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ProductReviewID
        {
            get
            {
                return _ProductReviewID;
            }
            set
            {
                if (_ProductReviewID != value)
                {
                    OnProductReviewIDChanging(value);
                    ReportPropertyChanging("ProductReviewID");
                    _ProductReviewID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ProductReviewID");
                    OnProductReviewIDChanged();
                }
            }
        }
        private global::System.Int32 _ProductReviewID;
        partial void OnProductReviewIDChanging(global::System.Int32 value);
        partial void OnProductReviewIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ProductID
        {
            get
            {
                return _ProductID;
            }
            set
            {
                OnProductIDChanging(value);
                ReportPropertyChanging("ProductID");
                _ProductID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ProductID");
                OnProductIDChanged();
            }
        }
        private global::System.Int32 _ProductID;
        partial void OnProductIDChanging(global::System.Int32 value);
        partial void OnProductIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String ReviewerName
        {
            get
            {
                return _ReviewerName;
            }
            set
            {
                OnReviewerNameChanging(value);
                ReportPropertyChanging("ReviewerName");
                _ReviewerName = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("ReviewerName");
                OnReviewerNameChanged();
            }
        }
        private global::System.String _ReviewerName;
        partial void OnReviewerNameChanging(global::System.String value);
        partial void OnReviewerNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ReviewDate
        {
            get
            {
                return _ReviewDate;
            }
            set
            {
                OnReviewDateChanging(value);
                ReportPropertyChanging("ReviewDate");
                _ReviewDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ReviewDate");
                OnReviewDateChanged();
            }
        }
        private global::System.DateTime _ReviewDate;
        partial void OnReviewDateChanging(global::System.DateTime value);
        partial void OnReviewDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String EmailAddress
        {
            get
            {
                return _EmailAddress;
            }
            set
            {
                OnEmailAddressChanging(value);
                ReportPropertyChanging("EmailAddress");
                _EmailAddress = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("EmailAddress");
                OnEmailAddressChanged();
            }
        }
        private global::System.String _EmailAddress;
        partial void OnEmailAddressChanging(global::System.String value);
        partial void OnEmailAddressChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 Rating
        {
            get
            {
                return _Rating;
            }
            set
            {
                OnRatingChanging(value);
                ReportPropertyChanging("Rating");
                _Rating = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("Rating");
                OnRatingChanged();
            }
        }
        private global::System.Int32 _Rating;
        partial void OnRatingChanging(global::System.Int32 value);
        partial void OnRatingChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String Comments
        {
            get
            {
                return _Comments;
            }
            set
            {
                OnCommentsChanging(value);
                ReportPropertyChanging("Comments");
                _Comments = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("Comments");
                OnCommentsChanged();
            }
        }
        private global::System.String _Comments;
        partial void OnCommentsChanging(global::System.String value);
        partial void OnCommentsChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductReview_Product_ProductID", "Product")]
        public Product Product
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_ProductReview_Product_ProductID", "Product").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_ProductReview_Product_ProductID", "Product").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Product> ProductReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_ProductReview_Product_ProductID", "Product");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Product>("AdventureWorksModel.FK_ProductReview_Product_ProductID", "Product", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="ProductSubcategory")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class ProductSubcategory : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new ProductSubcategory object.
        /// </summary>
        /// <param name="productSubcategoryID">Initial value of the ProductSubcategoryID property.</param>
        /// <param name="productCategoryID">Initial value of the ProductCategoryID property.</param>
        /// <param name="name">Initial value of the Name property.</param>
        /// <param name="rowguid">Initial value of the rowguid property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static ProductSubcategory CreateProductSubcategory(global::System.Int32 productSubcategoryID, global::System.Int32 productCategoryID, global::System.String name, global::System.Guid rowguid, global::System.DateTime modifiedDate)
        {
            ProductSubcategory productSubcategory = new ProductSubcategory();
            productSubcategory.ProductSubcategoryID = productSubcategoryID;
            productSubcategory.ProductCategoryID = productCategoryID;
            productSubcategory.Name = name;
            productSubcategory.rowguid = rowguid;
            productSubcategory.ModifiedDate = modifiedDate;
            return productSubcategory;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ProductSubcategoryID
        {
            get
            {
                return _ProductSubcategoryID;
            }
            set
            {
                if (_ProductSubcategoryID != value)
                {
                    OnProductSubcategoryIDChanging(value);
                    ReportPropertyChanging("ProductSubcategoryID");
                    _ProductSubcategoryID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ProductSubcategoryID");
                    OnProductSubcategoryIDChanged();
                }
            }
        }
        private global::System.Int32 _ProductSubcategoryID;
        partial void OnProductSubcategoryIDChanging(global::System.Int32 value);
        partial void OnProductSubcategoryIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ProductCategoryID
        {
            get
            {
                return _ProductCategoryID;
            }
            set
            {
                OnProductCategoryIDChanging(value);
                ReportPropertyChanging("ProductCategoryID");
                _ProductCategoryID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ProductCategoryID");
                OnProductCategoryIDChanged();
            }
        }
        private global::System.Int32 _ProductCategoryID;
        partial void OnProductCategoryIDChanging(global::System.Int32 value);
        partial void OnProductCategoryIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Name
        {
            get
            {
                return _Name;
            }
            set
            {
                OnNameChanging(value);
                ReportPropertyChanging("Name");
                _Name = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Name");
                OnNameChanged();
            }
        }
        private global::System.String _Name;
        partial void OnNameChanging(global::System.String value);
        partial void OnNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Guid rowguid
        {
            get
            {
                return _rowguid;
            }
            set
            {
                OnrowguidChanging(value);
                ReportPropertyChanging("rowguid");
                _rowguid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("rowguid");
                OnrowguidChanged();
            }
        }
        private global::System.Guid _rowguid;
        partial void OnrowguidChanging(global::System.Guid value);
        partial void OnrowguidChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_Product_ProductSubcategory_ProductSubcategoryID", "Product")]
        public EntityCollection<Product> Products
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<Product>("AdventureWorksModel.FK_Product_ProductSubcategory_ProductSubcategoryID", "Product");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<Product>("AdventureWorksModel.FK_Product_ProductSubcategory_ProductSubcategoryID", "Product", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductSubcategory_ProductCategory_ProductCategoryID", "ProductCategory")]
        public ProductCategory ProductCategory
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductCategory>("AdventureWorksModel.FK_ProductSubcategory_ProductCategory_ProductCategoryID", "ProductCategory").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductCategory>("AdventureWorksModel.FK_ProductSubcategory_ProductCategory_ProductCategoryID", "ProductCategory").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<ProductCategory> ProductCategoryReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductCategory>("AdventureWorksModel.FK_ProductSubcategory_ProductCategory_ProductCategoryID", "ProductCategory");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<ProductCategory>("AdventureWorksModel.FK_ProductSubcategory_ProductCategory_ProductCategoryID", "ProductCategory", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="ProductVendor")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class ProductVendor : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new ProductVendor object.
        /// </summary>
        /// <param name="productID">Initial value of the ProductID property.</param>
        /// <param name="vendorID">Initial value of the VendorID property.</param>
        /// <param name="averageLeadTime">Initial value of the AverageLeadTime property.</param>
        /// <param name="standardPrice">Initial value of the StandardPrice property.</param>
        /// <param name="minOrderQty">Initial value of the MinOrderQty property.</param>
        /// <param name="maxOrderQty">Initial value of the MaxOrderQty property.</param>
        /// <param name="unitMeasureCode">Initial value of the UnitMeasureCode property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static ProductVendor CreateProductVendor(global::System.Int32 productID, global::System.Int32 vendorID, global::System.Int32 averageLeadTime, global::System.Decimal standardPrice, global::System.Int32 minOrderQty, global::System.Int32 maxOrderQty, global::System.String unitMeasureCode, global::System.DateTime modifiedDate)
        {
            ProductVendor productVendor = new ProductVendor();
            productVendor.ProductID = productID;
            productVendor.VendorID = vendorID;
            productVendor.AverageLeadTime = averageLeadTime;
            productVendor.StandardPrice = standardPrice;
            productVendor.MinOrderQty = minOrderQty;
            productVendor.MaxOrderQty = maxOrderQty;
            productVendor.UnitMeasureCode = unitMeasureCode;
            productVendor.ModifiedDate = modifiedDate;
            return productVendor;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ProductID
        {
            get
            {
                return _ProductID;
            }
            set
            {
                if (_ProductID != value)
                {
                    OnProductIDChanging(value);
                    ReportPropertyChanging("ProductID");
                    _ProductID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ProductID");
                    OnProductIDChanged();
                }
            }
        }
        private global::System.Int32 _ProductID;
        partial void OnProductIDChanging(global::System.Int32 value);
        partial void OnProductIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 VendorID
        {
            get
            {
                return _VendorID;
            }
            set
            {
                if (_VendorID != value)
                {
                    OnVendorIDChanging(value);
                    ReportPropertyChanging("VendorID");
                    _VendorID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("VendorID");
                    OnVendorIDChanged();
                }
            }
        }
        private global::System.Int32 _VendorID;
        partial void OnVendorIDChanging(global::System.Int32 value);
        partial void OnVendorIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 AverageLeadTime
        {
            get
            {
                return _AverageLeadTime;
            }
            set
            {
                OnAverageLeadTimeChanging(value);
                ReportPropertyChanging("AverageLeadTime");
                _AverageLeadTime = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("AverageLeadTime");
                OnAverageLeadTimeChanged();
            }
        }
        private global::System.Int32 _AverageLeadTime;
        partial void OnAverageLeadTimeChanging(global::System.Int32 value);
        partial void OnAverageLeadTimeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal StandardPrice
        {
            get
            {
                return _StandardPrice;
            }
            set
            {
                OnStandardPriceChanging(value);
                ReportPropertyChanging("StandardPrice");
                _StandardPrice = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("StandardPrice");
                OnStandardPriceChanged();
            }
        }
        private global::System.Decimal _StandardPrice;
        partial void OnStandardPriceChanging(global::System.Decimal value);
        partial void OnStandardPriceChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Decimal> LastReceiptCost
        {
            get
            {
                return _LastReceiptCost;
            }
            set
            {
                OnLastReceiptCostChanging(value);
                ReportPropertyChanging("LastReceiptCost");
                _LastReceiptCost = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("LastReceiptCost");
                OnLastReceiptCostChanged();
            }
        }
        private Nullable<global::System.Decimal> _LastReceiptCost;
        partial void OnLastReceiptCostChanging(Nullable<global::System.Decimal> value);
        partial void OnLastReceiptCostChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.DateTime> LastReceiptDate
        {
            get
            {
                return _LastReceiptDate;
            }
            set
            {
                OnLastReceiptDateChanging(value);
                ReportPropertyChanging("LastReceiptDate");
                _LastReceiptDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("LastReceiptDate");
                OnLastReceiptDateChanged();
            }
        }
        private Nullable<global::System.DateTime> _LastReceiptDate;
        partial void OnLastReceiptDateChanging(Nullable<global::System.DateTime> value);
        partial void OnLastReceiptDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 MinOrderQty
        {
            get
            {
                return _MinOrderQty;
            }
            set
            {
                OnMinOrderQtyChanging(value);
                ReportPropertyChanging("MinOrderQty");
                _MinOrderQty = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("MinOrderQty");
                OnMinOrderQtyChanged();
            }
        }
        private global::System.Int32 _MinOrderQty;
        partial void OnMinOrderQtyChanging(global::System.Int32 value);
        partial void OnMinOrderQtyChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 MaxOrderQty
        {
            get
            {
                return _MaxOrderQty;
            }
            set
            {
                OnMaxOrderQtyChanging(value);
                ReportPropertyChanging("MaxOrderQty");
                _MaxOrderQty = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("MaxOrderQty");
                OnMaxOrderQtyChanged();
            }
        }
        private global::System.Int32 _MaxOrderQty;
        partial void OnMaxOrderQtyChanging(global::System.Int32 value);
        partial void OnMaxOrderQtyChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> OnOrderQty
        {
            get
            {
                return _OnOrderQty;
            }
            set
            {
                OnOnOrderQtyChanging(value);
                ReportPropertyChanging("OnOrderQty");
                _OnOrderQty = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("OnOrderQty");
                OnOnOrderQtyChanged();
            }
        }
        private Nullable<global::System.Int32> _OnOrderQty;
        partial void OnOnOrderQtyChanging(Nullable<global::System.Int32> value);
        partial void OnOnOrderQtyChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String UnitMeasureCode
        {
            get
            {
                return _UnitMeasureCode;
            }
            set
            {
                OnUnitMeasureCodeChanging(value);
                ReportPropertyChanging("UnitMeasureCode");
                _UnitMeasureCode = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("UnitMeasureCode");
                OnUnitMeasureCodeChanged();
            }
        }
        private global::System.String _UnitMeasureCode;
        partial void OnUnitMeasureCodeChanging(global::System.String value);
        partial void OnUnitMeasureCodeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductVendor_Product_ProductID", "Product")]
        public Product Product
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_ProductVendor_Product_ProductID", "Product").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_ProductVendor_Product_ProductID", "Product").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Product> ProductReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_ProductVendor_Product_ProductID", "Product");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Product>("AdventureWorksModel.FK_ProductVendor_Product_ProductID", "Product", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductVendor_UnitMeasure_UnitMeasureCode", "UnitMeasure")]
        public UnitMeasure UnitMeasure
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<UnitMeasure>("AdventureWorksModel.FK_ProductVendor_UnitMeasure_UnitMeasureCode", "UnitMeasure").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<UnitMeasure>("AdventureWorksModel.FK_ProductVendor_UnitMeasure_UnitMeasureCode", "UnitMeasure").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<UnitMeasure> UnitMeasureReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<UnitMeasure>("AdventureWorksModel.FK_ProductVendor_UnitMeasure_UnitMeasureCode", "UnitMeasure");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<UnitMeasure>("AdventureWorksModel.FK_ProductVendor_UnitMeasure_UnitMeasureCode", "UnitMeasure", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductVendor_Vendor_VendorID", "Vendor")]
        public Vendor Vendor
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Vendor>("AdventureWorksModel.FK_ProductVendor_Vendor_VendorID", "Vendor").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Vendor>("AdventureWorksModel.FK_ProductVendor_Vendor_VendorID", "Vendor").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Vendor> VendorReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Vendor>("AdventureWorksModel.FK_ProductVendor_Vendor_VendorID", "Vendor");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Vendor>("AdventureWorksModel.FK_ProductVendor_Vendor_VendorID", "Vendor", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="PurchaseOrderDetail")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class PurchaseOrderDetail : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new PurchaseOrderDetail object.
        /// </summary>
        /// <param name="purchaseOrderID">Initial value of the PurchaseOrderID property.</param>
        /// <param name="purchaseOrderDetailID">Initial value of the PurchaseOrderDetailID property.</param>
        /// <param name="dueDate">Initial value of the DueDate property.</param>
        /// <param name="orderQty">Initial value of the OrderQty property.</param>
        /// <param name="productID">Initial value of the ProductID property.</param>
        /// <param name="unitPrice">Initial value of the UnitPrice property.</param>
        /// <param name="lineTotal">Initial value of the LineTotal property.</param>
        /// <param name="receivedQty">Initial value of the ReceivedQty property.</param>
        /// <param name="rejectedQty">Initial value of the RejectedQty property.</param>
        /// <param name="stockedQty">Initial value of the StockedQty property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static PurchaseOrderDetail CreatePurchaseOrderDetail(global::System.Int32 purchaseOrderID, global::System.Int32 purchaseOrderDetailID, global::System.DateTime dueDate, global::System.Int16 orderQty, global::System.Int32 productID, global::System.Decimal unitPrice, global::System.Decimal lineTotal, global::System.Decimal receivedQty, global::System.Decimal rejectedQty, global::System.Decimal stockedQty, global::System.DateTime modifiedDate)
        {
            PurchaseOrderDetail purchaseOrderDetail = new PurchaseOrderDetail();
            purchaseOrderDetail.PurchaseOrderID = purchaseOrderID;
            purchaseOrderDetail.PurchaseOrderDetailID = purchaseOrderDetailID;
            purchaseOrderDetail.DueDate = dueDate;
            purchaseOrderDetail.OrderQty = orderQty;
            purchaseOrderDetail.ProductID = productID;
            purchaseOrderDetail.UnitPrice = unitPrice;
            purchaseOrderDetail.LineTotal = lineTotal;
            purchaseOrderDetail.ReceivedQty = receivedQty;
            purchaseOrderDetail.RejectedQty = rejectedQty;
            purchaseOrderDetail.StockedQty = stockedQty;
            purchaseOrderDetail.ModifiedDate = modifiedDate;
            return purchaseOrderDetail;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 PurchaseOrderID
        {
            get
            {
                return _PurchaseOrderID;
            }
            set
            {
                if (_PurchaseOrderID != value)
                {
                    OnPurchaseOrderIDChanging(value);
                    ReportPropertyChanging("PurchaseOrderID");
                    _PurchaseOrderID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("PurchaseOrderID");
                    OnPurchaseOrderIDChanged();
                }
            }
        }
        private global::System.Int32 _PurchaseOrderID;
        partial void OnPurchaseOrderIDChanging(global::System.Int32 value);
        partial void OnPurchaseOrderIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 PurchaseOrderDetailID
        {
            get
            {
                return _PurchaseOrderDetailID;
            }
            set
            {
                if (_PurchaseOrderDetailID != value)
                {
                    OnPurchaseOrderDetailIDChanging(value);
                    ReportPropertyChanging("PurchaseOrderDetailID");
                    _PurchaseOrderDetailID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("PurchaseOrderDetailID");
                    OnPurchaseOrderDetailIDChanged();
                }
            }
        }
        private global::System.Int32 _PurchaseOrderDetailID;
        partial void OnPurchaseOrderDetailIDChanging(global::System.Int32 value);
        partial void OnPurchaseOrderDetailIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime DueDate
        {
            get
            {
                return _DueDate;
            }
            set
            {
                OnDueDateChanging(value);
                ReportPropertyChanging("DueDate");
                _DueDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("DueDate");
                OnDueDateChanged();
            }
        }
        private global::System.DateTime _DueDate;
        partial void OnDueDateChanging(global::System.DateTime value);
        partial void OnDueDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int16 OrderQty
        {
            get
            {
                return _OrderQty;
            }
            set
            {
                OnOrderQtyChanging(value);
                ReportPropertyChanging("OrderQty");
                _OrderQty = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("OrderQty");
                OnOrderQtyChanged();
            }
        }
        private global::System.Int16 _OrderQty;
        partial void OnOrderQtyChanging(global::System.Int16 value);
        partial void OnOrderQtyChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ProductID
        {
            get
            {
                return _ProductID;
            }
            set
            {
                OnProductIDChanging(value);
                ReportPropertyChanging("ProductID");
                _ProductID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ProductID");
                OnProductIDChanged();
            }
        }
        private global::System.Int32 _ProductID;
        partial void OnProductIDChanging(global::System.Int32 value);
        partial void OnProductIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal UnitPrice
        {
            get
            {
                return _UnitPrice;
            }
            set
            {
                OnUnitPriceChanging(value);
                ReportPropertyChanging("UnitPrice");
                _UnitPrice = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("UnitPrice");
                OnUnitPriceChanged();
            }
        }
        private global::System.Decimal _UnitPrice;
        partial void OnUnitPriceChanging(global::System.Decimal value);
        partial void OnUnitPriceChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal LineTotal
        {
            get
            {
                return _LineTotal;
            }
            set
            {
                OnLineTotalChanging(value);
                ReportPropertyChanging("LineTotal");
                _LineTotal = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("LineTotal");
                OnLineTotalChanged();
            }
        }
        private global::System.Decimal _LineTotal;
        partial void OnLineTotalChanging(global::System.Decimal value);
        partial void OnLineTotalChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal ReceivedQty
        {
            get
            {
                return _ReceivedQty;
            }
            set
            {
                OnReceivedQtyChanging(value);
                ReportPropertyChanging("ReceivedQty");
                _ReceivedQty = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ReceivedQty");
                OnReceivedQtyChanged();
            }
        }
        private global::System.Decimal _ReceivedQty;
        partial void OnReceivedQtyChanging(global::System.Decimal value);
        partial void OnReceivedQtyChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal RejectedQty
        {
            get
            {
                return _RejectedQty;
            }
            set
            {
                OnRejectedQtyChanging(value);
                ReportPropertyChanging("RejectedQty");
                _RejectedQty = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("RejectedQty");
                OnRejectedQtyChanged();
            }
        }
        private global::System.Decimal _RejectedQty;
        partial void OnRejectedQtyChanging(global::System.Decimal value);
        partial void OnRejectedQtyChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal StockedQty
        {
            get
            {
                return _StockedQty;
            }
            set
            {
                OnStockedQtyChanging(value);
                ReportPropertyChanging("StockedQty");
                _StockedQty = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("StockedQty");
                OnStockedQtyChanged();
            }
        }
        private global::System.Decimal _StockedQty;
        partial void OnStockedQtyChanging(global::System.Decimal value);
        partial void OnStockedQtyChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_PurchaseOrderDetail_Product_ProductID", "Product")]
        public Product Product
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_PurchaseOrderDetail_Product_ProductID", "Product").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_PurchaseOrderDetail_Product_ProductID", "Product").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Product> ProductReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_PurchaseOrderDetail_Product_ProductID", "Product");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Product>("AdventureWorksModel.FK_PurchaseOrderDetail_Product_ProductID", "Product", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID", "PurchaseOrderHeader")]
        public PurchaseOrderHeader PurchaseOrderHeader
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<PurchaseOrderHeader>("AdventureWorksModel.FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID", "PurchaseOrderHeader").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<PurchaseOrderHeader>("AdventureWorksModel.FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID", "PurchaseOrderHeader").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<PurchaseOrderHeader> PurchaseOrderHeaderReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<PurchaseOrderHeader>("AdventureWorksModel.FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID", "PurchaseOrderHeader");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<PurchaseOrderHeader>("AdventureWorksModel.FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID", "PurchaseOrderHeader", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="PurchaseOrderHeader")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class PurchaseOrderHeader : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new PurchaseOrderHeader object.
        /// </summary>
        /// <param name="purchaseOrderID">Initial value of the PurchaseOrderID property.</param>
        /// <param name="revisionNumber">Initial value of the RevisionNumber property.</param>
        /// <param name="status">Initial value of the Status property.</param>
        /// <param name="employeeID">Initial value of the EmployeeID property.</param>
        /// <param name="vendorID">Initial value of the VendorID property.</param>
        /// <param name="shipMethodID">Initial value of the ShipMethodID property.</param>
        /// <param name="orderDate">Initial value of the OrderDate property.</param>
        /// <param name="subTotal">Initial value of the SubTotal property.</param>
        /// <param name="taxAmt">Initial value of the TaxAmt property.</param>
        /// <param name="freight">Initial value of the Freight property.</param>
        /// <param name="totalDue">Initial value of the TotalDue property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static PurchaseOrderHeader CreatePurchaseOrderHeader(global::System.Int32 purchaseOrderID, global::System.Byte revisionNumber, global::System.Byte status, global::System.Int32 employeeID, global::System.Int32 vendorID, global::System.Int32 shipMethodID, global::System.DateTime orderDate, global::System.Decimal subTotal, global::System.Decimal taxAmt, global::System.Decimal freight, global::System.Decimal totalDue, global::System.DateTime modifiedDate)
        {
            PurchaseOrderHeader purchaseOrderHeader = new PurchaseOrderHeader();
            purchaseOrderHeader.PurchaseOrderID = purchaseOrderID;
            purchaseOrderHeader.RevisionNumber = revisionNumber;
            purchaseOrderHeader.Status = status;
            purchaseOrderHeader.EmployeeID = employeeID;
            purchaseOrderHeader.VendorID = vendorID;
            purchaseOrderHeader.ShipMethodID = shipMethodID;
            purchaseOrderHeader.OrderDate = orderDate;
            purchaseOrderHeader.SubTotal = subTotal;
            purchaseOrderHeader.TaxAmt = taxAmt;
            purchaseOrderHeader.Freight = freight;
            purchaseOrderHeader.TotalDue = totalDue;
            purchaseOrderHeader.ModifiedDate = modifiedDate;
            return purchaseOrderHeader;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 PurchaseOrderID
        {
            get
            {
                return _PurchaseOrderID;
            }
            set
            {
                if (_PurchaseOrderID != value)
                {
                    OnPurchaseOrderIDChanging(value);
                    ReportPropertyChanging("PurchaseOrderID");
                    _PurchaseOrderID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("PurchaseOrderID");
                    OnPurchaseOrderIDChanged();
                }
            }
        }
        private global::System.Int32 _PurchaseOrderID;
        partial void OnPurchaseOrderIDChanging(global::System.Int32 value);
        partial void OnPurchaseOrderIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Byte RevisionNumber
        {
            get
            {
                return _RevisionNumber;
            }
            set
            {
                OnRevisionNumberChanging(value);
                ReportPropertyChanging("RevisionNumber");
                _RevisionNumber = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("RevisionNumber");
                OnRevisionNumberChanged();
            }
        }
        private global::System.Byte _RevisionNumber;
        partial void OnRevisionNumberChanging(global::System.Byte value);
        partial void OnRevisionNumberChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Byte Status
        {
            get
            {
                return _Status;
            }
            set
            {
                OnStatusChanging(value);
                ReportPropertyChanging("Status");
                _Status = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("Status");
                OnStatusChanged();
            }
        }
        private global::System.Byte _Status;
        partial void OnStatusChanging(global::System.Byte value);
        partial void OnStatusChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 EmployeeID
        {
            get
            {
                return _EmployeeID;
            }
            set
            {
                OnEmployeeIDChanging(value);
                ReportPropertyChanging("EmployeeID");
                _EmployeeID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("EmployeeID");
                OnEmployeeIDChanged();
            }
        }
        private global::System.Int32 _EmployeeID;
        partial void OnEmployeeIDChanging(global::System.Int32 value);
        partial void OnEmployeeIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 VendorID
        {
            get
            {
                return _VendorID;
            }
            set
            {
                OnVendorIDChanging(value);
                ReportPropertyChanging("VendorID");
                _VendorID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("VendorID");
                OnVendorIDChanged();
            }
        }
        private global::System.Int32 _VendorID;
        partial void OnVendorIDChanging(global::System.Int32 value);
        partial void OnVendorIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ShipMethodID
        {
            get
            {
                return _ShipMethodID;
            }
            set
            {
                OnShipMethodIDChanging(value);
                ReportPropertyChanging("ShipMethodID");
                _ShipMethodID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ShipMethodID");
                OnShipMethodIDChanged();
            }
        }
        private global::System.Int32 _ShipMethodID;
        partial void OnShipMethodIDChanging(global::System.Int32 value);
        partial void OnShipMethodIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime OrderDate
        {
            get
            {
                return _OrderDate;
            }
            set
            {
                OnOrderDateChanging(value);
                ReportPropertyChanging("OrderDate");
                _OrderDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("OrderDate");
                OnOrderDateChanged();
            }
        }
        private global::System.DateTime _OrderDate;
        partial void OnOrderDateChanging(global::System.DateTime value);
        partial void OnOrderDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.DateTime> ShipDate
        {
            get
            {
                return _ShipDate;
            }
            set
            {
                OnShipDateChanging(value);
                ReportPropertyChanging("ShipDate");
                _ShipDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ShipDate");
                OnShipDateChanged();
            }
        }
        private Nullable<global::System.DateTime> _ShipDate;
        partial void OnShipDateChanging(Nullable<global::System.DateTime> value);
        partial void OnShipDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal SubTotal
        {
            get
            {
                return _SubTotal;
            }
            set
            {
                OnSubTotalChanging(value);
                ReportPropertyChanging("SubTotal");
                _SubTotal = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("SubTotal");
                OnSubTotalChanged();
            }
        }
        private global::System.Decimal _SubTotal;
        partial void OnSubTotalChanging(global::System.Decimal value);
        partial void OnSubTotalChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal TaxAmt
        {
            get
            {
                return _TaxAmt;
            }
            set
            {
                OnTaxAmtChanging(value);
                ReportPropertyChanging("TaxAmt");
                _TaxAmt = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("TaxAmt");
                OnTaxAmtChanged();
            }
        }
        private global::System.Decimal _TaxAmt;
        partial void OnTaxAmtChanging(global::System.Decimal value);
        partial void OnTaxAmtChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal Freight
        {
            get
            {
                return _Freight;
            }
            set
            {
                OnFreightChanging(value);
                ReportPropertyChanging("Freight");
                _Freight = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("Freight");
                OnFreightChanged();
            }
        }
        private global::System.Decimal _Freight;
        partial void OnFreightChanging(global::System.Decimal value);
        partial void OnFreightChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal TotalDue
        {
            get
            {
                return _TotalDue;
            }
            set
            {
                OnTotalDueChanging(value);
                ReportPropertyChanging("TotalDue");
                _TotalDue = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("TotalDue");
                OnTotalDueChanged();
            }
        }
        private global::System.Decimal _TotalDue;
        partial void OnTotalDueChanging(global::System.Decimal value);
        partial void OnTotalDueChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_PurchaseOrderHeader_Employee_EmployeeID", "Employee")]
        public Employee Employee
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Employee>("AdventureWorksModel.FK_PurchaseOrderHeader_Employee_EmployeeID", "Employee").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Employee>("AdventureWorksModel.FK_PurchaseOrderHeader_Employee_EmployeeID", "Employee").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Employee> EmployeeReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Employee>("AdventureWorksModel.FK_PurchaseOrderHeader_Employee_EmployeeID", "Employee");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Employee>("AdventureWorksModel.FK_PurchaseOrderHeader_Employee_EmployeeID", "Employee", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID", "PurchaseOrderDetail")]
        public EntityCollection<PurchaseOrderDetail> PurchaseOrderDetails
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<PurchaseOrderDetail>("AdventureWorksModel.FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID", "PurchaseOrderDetail");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<PurchaseOrderDetail>("AdventureWorksModel.FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID", "PurchaseOrderDetail", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_PurchaseOrderHeader_ShipMethod_ShipMethodID", "ShipMethod")]
        public ShipMethod ShipMethod
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ShipMethod>("AdventureWorksModel.FK_PurchaseOrderHeader_ShipMethod_ShipMethodID", "ShipMethod").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ShipMethod>("AdventureWorksModel.FK_PurchaseOrderHeader_ShipMethod_ShipMethodID", "ShipMethod").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<ShipMethod> ShipMethodReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ShipMethod>("AdventureWorksModel.FK_PurchaseOrderHeader_ShipMethod_ShipMethodID", "ShipMethod");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<ShipMethod>("AdventureWorksModel.FK_PurchaseOrderHeader_ShipMethod_ShipMethodID", "ShipMethod", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_PurchaseOrderHeader_Vendor_VendorID", "Vendor")]
        public Vendor Vendor
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Vendor>("AdventureWorksModel.FK_PurchaseOrderHeader_Vendor_VendorID", "Vendor").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Vendor>("AdventureWorksModel.FK_PurchaseOrderHeader_Vendor_VendorID", "Vendor").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Vendor> VendorReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Vendor>("AdventureWorksModel.FK_PurchaseOrderHeader_Vendor_VendorID", "Vendor");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Vendor>("AdventureWorksModel.FK_PurchaseOrderHeader_Vendor_VendorID", "Vendor", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="SalesOrderDetail")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class SalesOrderDetail : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new SalesOrderDetail object.
        /// </summary>
        /// <param name="salesOrderID">Initial value of the SalesOrderID property.</param>
        /// <param name="salesOrderDetailID">Initial value of the SalesOrderDetailID property.</param>
        /// <param name="orderQty">Initial value of the OrderQty property.</param>
        /// <param name="productID">Initial value of the ProductID property.</param>
        /// <param name="specialOfferID">Initial value of the SpecialOfferID property.</param>
        /// <param name="unitPrice">Initial value of the UnitPrice property.</param>
        /// <param name="unitPriceDiscount">Initial value of the UnitPriceDiscount property.</param>
        /// <param name="lineTotal">Initial value of the LineTotal property.</param>
        /// <param name="rowguid">Initial value of the rowguid property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static SalesOrderDetail CreateSalesOrderDetail(global::System.Int32 salesOrderID, global::System.Int32 salesOrderDetailID, global::System.Int16 orderQty, global::System.Int32 productID, global::System.Int32 specialOfferID, global::System.Decimal unitPrice, global::System.Decimal unitPriceDiscount, global::System.Decimal lineTotal, global::System.Guid rowguid, global::System.DateTime modifiedDate)
        {
            SalesOrderDetail salesOrderDetail = new SalesOrderDetail();
            salesOrderDetail.SalesOrderID = salesOrderID;
            salesOrderDetail.SalesOrderDetailID = salesOrderDetailID;
            salesOrderDetail.OrderQty = orderQty;
            salesOrderDetail.ProductID = productID;
            salesOrderDetail.SpecialOfferID = specialOfferID;
            salesOrderDetail.UnitPrice = unitPrice;
            salesOrderDetail.UnitPriceDiscount = unitPriceDiscount;
            salesOrderDetail.LineTotal = lineTotal;
            salesOrderDetail.rowguid = rowguid;
            salesOrderDetail.ModifiedDate = modifiedDate;
            return salesOrderDetail;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 SalesOrderID
        {
            get
            {
                return _SalesOrderID;
            }
            set
            {
                if (_SalesOrderID != value)
                {
                    OnSalesOrderIDChanging(value);
                    ReportPropertyChanging("SalesOrderID");
                    _SalesOrderID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("SalesOrderID");
                    OnSalesOrderIDChanged();
                }
            }
        }
        private global::System.Int32 _SalesOrderID;
        partial void OnSalesOrderIDChanging(global::System.Int32 value);
        partial void OnSalesOrderIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 SalesOrderDetailID
        {
            get
            {
                return _SalesOrderDetailID;
            }
            set
            {
                if (_SalesOrderDetailID != value)
                {
                    OnSalesOrderDetailIDChanging(value);
                    ReportPropertyChanging("SalesOrderDetailID");
                    _SalesOrderDetailID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("SalesOrderDetailID");
                    OnSalesOrderDetailIDChanged();
                }
            }
        }
        private global::System.Int32 _SalesOrderDetailID;
        partial void OnSalesOrderDetailIDChanging(global::System.Int32 value);
        partial void OnSalesOrderDetailIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String CarrierTrackingNumber
        {
            get
            {
                return _CarrierTrackingNumber;
            }
            set
            {
                OnCarrierTrackingNumberChanging(value);
                ReportPropertyChanging("CarrierTrackingNumber");
                _CarrierTrackingNumber = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("CarrierTrackingNumber");
                OnCarrierTrackingNumberChanged();
            }
        }
        private global::System.String _CarrierTrackingNumber;
        partial void OnCarrierTrackingNumberChanging(global::System.String value);
        partial void OnCarrierTrackingNumberChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int16 OrderQty
        {
            get
            {
                return _OrderQty;
            }
            set
            {
                OnOrderQtyChanging(value);
                ReportPropertyChanging("OrderQty");
                _OrderQty = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("OrderQty");
                OnOrderQtyChanged();
            }
        }
        private global::System.Int16 _OrderQty;
        partial void OnOrderQtyChanging(global::System.Int16 value);
        partial void OnOrderQtyChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ProductID
        {
            get
            {
                return _ProductID;
            }
            set
            {
                OnProductIDChanging(value);
                ReportPropertyChanging("ProductID");
                _ProductID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ProductID");
                OnProductIDChanged();
            }
        }
        private global::System.Int32 _ProductID;
        partial void OnProductIDChanging(global::System.Int32 value);
        partial void OnProductIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 SpecialOfferID
        {
            get
            {
                return _SpecialOfferID;
            }
            set
            {
                OnSpecialOfferIDChanging(value);
                ReportPropertyChanging("SpecialOfferID");
                _SpecialOfferID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("SpecialOfferID");
                OnSpecialOfferIDChanged();
            }
        }
        private global::System.Int32 _SpecialOfferID;
        partial void OnSpecialOfferIDChanging(global::System.Int32 value);
        partial void OnSpecialOfferIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal UnitPrice
        {
            get
            {
                return _UnitPrice;
            }
            set
            {
                OnUnitPriceChanging(value);
                ReportPropertyChanging("UnitPrice");
                _UnitPrice = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("UnitPrice");
                OnUnitPriceChanged();
            }
        }
        private global::System.Decimal _UnitPrice;
        partial void OnUnitPriceChanging(global::System.Decimal value);
        partial void OnUnitPriceChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal UnitPriceDiscount
        {
            get
            {
                return _UnitPriceDiscount;
            }
            set
            {
                OnUnitPriceDiscountChanging(value);
                ReportPropertyChanging("UnitPriceDiscount");
                _UnitPriceDiscount = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("UnitPriceDiscount");
                OnUnitPriceDiscountChanged();
            }
        }
        private global::System.Decimal _UnitPriceDiscount;
        partial void OnUnitPriceDiscountChanging(global::System.Decimal value);
        partial void OnUnitPriceDiscountChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal LineTotal
        {
            get
            {
                return _LineTotal;
            }
            set
            {
                OnLineTotalChanging(value);
                ReportPropertyChanging("LineTotal");
                _LineTotal = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("LineTotal");
                OnLineTotalChanged();
            }
        }
        private global::System.Decimal _LineTotal;
        partial void OnLineTotalChanging(global::System.Decimal value);
        partial void OnLineTotalChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Guid rowguid
        {
            get
            {
                return _rowguid;
            }
            set
            {
                OnrowguidChanging(value);
                ReportPropertyChanging("rowguid");
                _rowguid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("rowguid");
                OnrowguidChanged();
            }
        }
        private global::System.Guid _rowguid;
        partial void OnrowguidChanging(global::System.Guid value);
        partial void OnrowguidChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderHeader")]
        public SalesOrderHeader SalesOrderHeader
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesOrderHeader>("AdventureWorksModel.FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderHeader").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesOrderHeader>("AdventureWorksModel.FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderHeader").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<SalesOrderHeader> SalesOrderHeaderReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesOrderHeader>("AdventureWorksModel.FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderHeader");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<SalesOrderHeader>("AdventureWorksModel.FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderHeader", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID", "SpecialOfferProduct")]
        public SpecialOfferProduct SpecialOfferProduct
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SpecialOfferProduct>("AdventureWorksModel.FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID", "SpecialOfferProduct").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SpecialOfferProduct>("AdventureWorksModel.FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID", "SpecialOfferProduct").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<SpecialOfferProduct> SpecialOfferProductReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SpecialOfferProduct>("AdventureWorksModel.FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID", "SpecialOfferProduct");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<SpecialOfferProduct>("AdventureWorksModel.FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID", "SpecialOfferProduct", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="SalesOrderHeader")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class SalesOrderHeader : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new SalesOrderHeader object.
        /// </summary>
        /// <param name="salesOrderID">Initial value of the SalesOrderID property.</param>
        /// <param name="revisionNumber">Initial value of the RevisionNumber property.</param>
        /// <param name="orderDate">Initial value of the OrderDate property.</param>
        /// <param name="dueDate">Initial value of the DueDate property.</param>
        /// <param name="status">Initial value of the Status property.</param>
        /// <param name="onlineOrderFlag">Initial value of the OnlineOrderFlag property.</param>
        /// <param name="salesOrderNumber">Initial value of the SalesOrderNumber property.</param>
        /// <param name="customerID">Initial value of the CustomerID property.</param>
        /// <param name="contactID">Initial value of the ContactID property.</param>
        /// <param name="billToAddressID">Initial value of the BillToAddressID property.</param>
        /// <param name="shipToAddressID">Initial value of the ShipToAddressID property.</param>
        /// <param name="shipMethodID">Initial value of the ShipMethodID property.</param>
        /// <param name="subTotal">Initial value of the SubTotal property.</param>
        /// <param name="taxAmt">Initial value of the TaxAmt property.</param>
        /// <param name="freight">Initial value of the Freight property.</param>
        /// <param name="totalDue">Initial value of the TotalDue property.</param>
        /// <param name="rowguid">Initial value of the rowguid property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 salesOrderID, global::System.Byte revisionNumber, global::System.DateTime orderDate, global::System.DateTime dueDate, global::System.Byte status, global::System.Boolean onlineOrderFlag, global::System.String salesOrderNumber, global::System.Int32 customerID, global::System.Int32 contactID, global::System.Int32 billToAddressID, global::System.Int32 shipToAddressID, global::System.Int32 shipMethodID, global::System.Decimal subTotal, global::System.Decimal taxAmt, global::System.Decimal freight, global::System.Decimal totalDue, global::System.Guid rowguid, global::System.DateTime modifiedDate)
        {
            SalesOrderHeader salesOrderHeader = new SalesOrderHeader();
            salesOrderHeader.SalesOrderID = salesOrderID;
            salesOrderHeader.RevisionNumber = revisionNumber;
            salesOrderHeader.OrderDate = orderDate;
            salesOrderHeader.DueDate = dueDate;
            salesOrderHeader.Status = status;
            salesOrderHeader.OnlineOrderFlag = onlineOrderFlag;
            salesOrderHeader.SalesOrderNumber = salesOrderNumber;
            salesOrderHeader.CustomerID = customerID;
            salesOrderHeader.ContactID = contactID;
            salesOrderHeader.BillToAddressID = billToAddressID;
            salesOrderHeader.ShipToAddressID = shipToAddressID;
            salesOrderHeader.ShipMethodID = shipMethodID;
            salesOrderHeader.SubTotal = subTotal;
            salesOrderHeader.TaxAmt = taxAmt;
            salesOrderHeader.Freight = freight;
            salesOrderHeader.TotalDue = totalDue;
            salesOrderHeader.rowguid = rowguid;
            salesOrderHeader.ModifiedDate = modifiedDate;
            return salesOrderHeader;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 SalesOrderID
        {
            get
            {
                return _SalesOrderID;
            }
            set
            {
                if (_SalesOrderID != value)
                {
                    OnSalesOrderIDChanging(value);
                    ReportPropertyChanging("SalesOrderID");
                    _SalesOrderID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("SalesOrderID");
                    OnSalesOrderIDChanged();
                }
            }
        }
        private global::System.Int32 _SalesOrderID;
        partial void OnSalesOrderIDChanging(global::System.Int32 value);
        partial void OnSalesOrderIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Byte RevisionNumber
        {
            get
            {
                return _RevisionNumber;
            }
            set
            {
                OnRevisionNumberChanging(value);
                ReportPropertyChanging("RevisionNumber");
                _RevisionNumber = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("RevisionNumber");
                OnRevisionNumberChanged();
            }
        }
        private global::System.Byte _RevisionNumber;
        partial void OnRevisionNumberChanging(global::System.Byte value);
        partial void OnRevisionNumberChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime OrderDate
        {
            get
            {
                return _OrderDate;
            }
            set
            {
                OnOrderDateChanging(value);
                ReportPropertyChanging("OrderDate");
                _OrderDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("OrderDate");
                OnOrderDateChanged();
            }
        }
        private global::System.DateTime _OrderDate;
        partial void OnOrderDateChanging(global::System.DateTime value);
        partial void OnOrderDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime DueDate
        {
            get
            {
                return _DueDate;
            }
            set
            {
                OnDueDateChanging(value);
                ReportPropertyChanging("DueDate");
                _DueDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("DueDate");
                OnDueDateChanged();
            }
        }
        private global::System.DateTime _DueDate;
        partial void OnDueDateChanging(global::System.DateTime value);
        partial void OnDueDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.DateTime> ShipDate
        {
            get
            {
                return _ShipDate;
            }
            set
            {
                OnShipDateChanging(value);
                ReportPropertyChanging("ShipDate");
                _ShipDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ShipDate");
                OnShipDateChanged();
            }
        }
        private Nullable<global::System.DateTime> _ShipDate;
        partial void OnShipDateChanging(Nullable<global::System.DateTime> value);
        partial void OnShipDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Byte Status
        {
            get
            {
                return _Status;
            }
            set
            {
                OnStatusChanging(value);
                ReportPropertyChanging("Status");
                _Status = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("Status");
                OnStatusChanged();
            }
        }
        private global::System.Byte _Status;
        partial void OnStatusChanging(global::System.Byte value);
        partial void OnStatusChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Boolean OnlineOrderFlag
        {
            get
            {
                return _OnlineOrderFlag;
            }
            set
            {
                OnOnlineOrderFlagChanging(value);
                ReportPropertyChanging("OnlineOrderFlag");
                _OnlineOrderFlag = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("OnlineOrderFlag");
                OnOnlineOrderFlagChanged();
            }
        }
        private global::System.Boolean _OnlineOrderFlag;
        partial void OnOnlineOrderFlagChanging(global::System.Boolean value);
        partial void OnOnlineOrderFlagChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String SalesOrderNumber
        {
            get
            {
                return _SalesOrderNumber;
            }
            set
            {
                OnSalesOrderNumberChanging(value);
                ReportPropertyChanging("SalesOrderNumber");
                _SalesOrderNumber = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("SalesOrderNumber");
                OnSalesOrderNumberChanged();
            }
        }
        private global::System.String _SalesOrderNumber;
        partial void OnSalesOrderNumberChanging(global::System.String value);
        partial void OnSalesOrderNumberChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String PurchaseOrderNumber
        {
            get
            {
                return _PurchaseOrderNumber;
            }
            set
            {
                OnPurchaseOrderNumberChanging(value);
                ReportPropertyChanging("PurchaseOrderNumber");
                _PurchaseOrderNumber = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("PurchaseOrderNumber");
                OnPurchaseOrderNumberChanged();
            }
        }
        private global::System.String _PurchaseOrderNumber;
        partial void OnPurchaseOrderNumberChanging(global::System.String value);
        partial void OnPurchaseOrderNumberChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String AccountNumber
        {
            get
            {
                return _AccountNumber;
            }
            set
            {
                OnAccountNumberChanging(value);
                ReportPropertyChanging("AccountNumber");
                _AccountNumber = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("AccountNumber");
                OnAccountNumberChanged();
            }
        }
        private global::System.String _AccountNumber;
        partial void OnAccountNumberChanging(global::System.String value);
        partial void OnAccountNumberChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 CustomerID
        {
            get
            {
                return _CustomerID;
            }
            set
            {
                OnCustomerIDChanging(value);
                ReportPropertyChanging("CustomerID");
                _CustomerID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("CustomerID");
                OnCustomerIDChanged();
            }
        }
        private global::System.Int32 _CustomerID;
        partial void OnCustomerIDChanging(global::System.Int32 value);
        partial void OnCustomerIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ContactID
        {
            get
            {
                return _ContactID;
            }
            set
            {
                OnContactIDChanging(value);
                ReportPropertyChanging("ContactID");
                _ContactID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ContactID");
                OnContactIDChanged();
            }
        }
        private global::System.Int32 _ContactID;
        partial void OnContactIDChanging(global::System.Int32 value);
        partial void OnContactIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> SalesPersonID
        {
            get
            {
                return _SalesPersonID;
            }
            set
            {
                OnSalesPersonIDChanging(value);
                ReportPropertyChanging("SalesPersonID");
                _SalesPersonID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("SalesPersonID");
                OnSalesPersonIDChanged();
            }
        }
        private Nullable<global::System.Int32> _SalesPersonID;
        partial void OnSalesPersonIDChanging(Nullable<global::System.Int32> value);
        partial void OnSalesPersonIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> TerritoryID
        {
            get
            {
                return _TerritoryID;
            }
            set
            {
                OnTerritoryIDChanging(value);
                ReportPropertyChanging("TerritoryID");
                _TerritoryID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("TerritoryID");
                OnTerritoryIDChanged();
            }
        }
        private Nullable<global::System.Int32> _TerritoryID;
        partial void OnTerritoryIDChanging(Nullable<global::System.Int32> value);
        partial void OnTerritoryIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 BillToAddressID
        {
            get
            {
                return _BillToAddressID;
            }
            set
            {
                OnBillToAddressIDChanging(value);
                ReportPropertyChanging("BillToAddressID");
                _BillToAddressID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("BillToAddressID");
                OnBillToAddressIDChanged();
            }
        }
        private global::System.Int32 _BillToAddressID;
        partial void OnBillToAddressIDChanging(global::System.Int32 value);
        partial void OnBillToAddressIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ShipToAddressID
        {
            get
            {
                return _ShipToAddressID;
            }
            set
            {
                OnShipToAddressIDChanging(value);
                ReportPropertyChanging("ShipToAddressID");
                _ShipToAddressID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ShipToAddressID");
                OnShipToAddressIDChanged();
            }
        }
        private global::System.Int32 _ShipToAddressID;
        partial void OnShipToAddressIDChanging(global::System.Int32 value);
        partial void OnShipToAddressIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ShipMethodID
        {
            get
            {
                return _ShipMethodID;
            }
            set
            {
                OnShipMethodIDChanging(value);
                ReportPropertyChanging("ShipMethodID");
                _ShipMethodID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ShipMethodID");
                OnShipMethodIDChanged();
            }
        }
        private global::System.Int32 _ShipMethodID;
        partial void OnShipMethodIDChanging(global::System.Int32 value);
        partial void OnShipMethodIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> CreditCardID
        {
            get
            {
                return _CreditCardID;
            }
            set
            {
                OnCreditCardIDChanging(value);
                ReportPropertyChanging("CreditCardID");
                _CreditCardID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("CreditCardID");
                OnCreditCardIDChanged();
            }
        }
        private Nullable<global::System.Int32> _CreditCardID;
        partial void OnCreditCardIDChanging(Nullable<global::System.Int32> value);
        partial void OnCreditCardIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String CreditCardApprovalCode
        {
            get
            {
                return _CreditCardApprovalCode;
            }
            set
            {
                OnCreditCardApprovalCodeChanging(value);
                ReportPropertyChanging("CreditCardApprovalCode");
                _CreditCardApprovalCode = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("CreditCardApprovalCode");
                OnCreditCardApprovalCodeChanged();
            }
        }
        private global::System.String _CreditCardApprovalCode;
        partial void OnCreditCardApprovalCodeChanging(global::System.String value);
        partial void OnCreditCardApprovalCodeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> CurrencyRateID
        {
            get
            {
                return _CurrencyRateID;
            }
            set
            {
                OnCurrencyRateIDChanging(value);
                ReportPropertyChanging("CurrencyRateID");
                _CurrencyRateID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("CurrencyRateID");
                OnCurrencyRateIDChanged();
            }
        }
        private Nullable<global::System.Int32> _CurrencyRateID;
        partial void OnCurrencyRateIDChanging(Nullable<global::System.Int32> value);
        partial void OnCurrencyRateIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal SubTotal
        {
            get
            {
                return _SubTotal;
            }
            set
            {
                OnSubTotalChanging(value);
                ReportPropertyChanging("SubTotal");
                _SubTotal = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("SubTotal");
                OnSubTotalChanged();
            }
        }
        private global::System.Decimal _SubTotal;
        partial void OnSubTotalChanging(global::System.Decimal value);
        partial void OnSubTotalChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal TaxAmt
        {
            get
            {
                return _TaxAmt;
            }
            set
            {
                OnTaxAmtChanging(value);
                ReportPropertyChanging("TaxAmt");
                _TaxAmt = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("TaxAmt");
                OnTaxAmtChanged();
            }
        }
        private global::System.Decimal _TaxAmt;
        partial void OnTaxAmtChanging(global::System.Decimal value);
        partial void OnTaxAmtChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal Freight
        {
            get
            {
                return _Freight;
            }
            set
            {
                OnFreightChanging(value);
                ReportPropertyChanging("Freight");
                _Freight = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("Freight");
                OnFreightChanged();
            }
        }
        private global::System.Decimal _Freight;
        partial void OnFreightChanging(global::System.Decimal value);
        partial void OnFreightChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal TotalDue
        {
            get
            {
                return _TotalDue;
            }
            set
            {
                OnTotalDueChanging(value);
                ReportPropertyChanging("TotalDue");
                _TotalDue = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("TotalDue");
                OnTotalDueChanged();
            }
        }
        private global::System.Decimal _TotalDue;
        partial void OnTotalDueChanging(global::System.Decimal value);
        partial void OnTotalDueChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String Comment
        {
            get
            {
                return _Comment;
            }
            set
            {
                OnCommentChanging(value);
                ReportPropertyChanging("Comment");
                _Comment = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("Comment");
                OnCommentChanged();
            }
        }
        private global::System.String _Comment;
        partial void OnCommentChanging(global::System.String value);
        partial void OnCommentChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Guid rowguid
        {
            get
            {
                return _rowguid;
            }
            set
            {
                OnrowguidChanging(value);
                ReportPropertyChanging("rowguid");
                _rowguid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("rowguid");
                OnrowguidChanged();
            }
        }
        private global::System.Guid _rowguid;
        partial void OnrowguidChanging(global::System.Guid value);
        partial void OnrowguidChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Address_BillToAddressID", "Address")]
        public Address Address
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Address>("AdventureWorksModel.FK_SalesOrderHeader_Address_BillToAddressID", "Address").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Address>("AdventureWorksModel.FK_SalesOrderHeader_Address_BillToAddressID", "Address").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Address> AddressReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Address>("AdventureWorksModel.FK_SalesOrderHeader_Address_BillToAddressID", "Address");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Address>("AdventureWorksModel.FK_SalesOrderHeader_Address_BillToAddressID", "Address", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Address_ShipToAddressID", "Address")]
        public Address Address1
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Address>("AdventureWorksModel.FK_SalesOrderHeader_Address_ShipToAddressID", "Address").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Address>("AdventureWorksModel.FK_SalesOrderHeader_Address_ShipToAddressID", "Address").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Address> Address1Reference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Address>("AdventureWorksModel.FK_SalesOrderHeader_Address_ShipToAddressID", "Address");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Address>("AdventureWorksModel.FK_SalesOrderHeader_Address_ShipToAddressID", "Address", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Contact_ContactID", "Contact")]
        public Contact Contact
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Contact>("AdventureWorksModel.FK_SalesOrderHeader_Contact_ContactID", "Contact").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Contact>("AdventureWorksModel.FK_SalesOrderHeader_Contact_ContactID", "Contact").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Contact> ContactReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Contact>("AdventureWorksModel.FK_SalesOrderHeader_Contact_ContactID", "Contact");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Contact>("AdventureWorksModel.FK_SalesOrderHeader_Contact_ContactID", "Contact", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_ShipMethod_ShipMethodID", "ShipMethod")]
        public ShipMethod ShipMethod
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ShipMethod>("AdventureWorksModel.FK_SalesOrderHeader_ShipMethod_ShipMethodID", "ShipMethod").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ShipMethod>("AdventureWorksModel.FK_SalesOrderHeader_ShipMethod_ShipMethodID", "ShipMethod").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<ShipMethod> ShipMethodReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ShipMethod>("AdventureWorksModel.FK_SalesOrderHeader_ShipMethod_ShipMethodID", "ShipMethod");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<ShipMethod>("AdventureWorksModel.FK_SalesOrderHeader_ShipMethod_ShipMethodID", "ShipMethod", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_CreditCard_CreditCardID", "CreditCard")]
        public CreditCard CreditCard
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<CreditCard>("AdventureWorksModel.FK_SalesOrderHeader_CreditCard_CreditCardID", "CreditCard").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<CreditCard>("AdventureWorksModel.FK_SalesOrderHeader_CreditCard_CreditCardID", "CreditCard").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<CreditCard> CreditCardReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<CreditCard>("AdventureWorksModel.FK_SalesOrderHeader_CreditCard_CreditCardID", "CreditCard");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<CreditCard>("AdventureWorksModel.FK_SalesOrderHeader_CreditCard_CreditCardID", "CreditCard", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_CurrencyRate_CurrencyRateID", "CurrencyRate")]
        public CurrencyRate CurrencyRate
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<CurrencyRate>("AdventureWorksModel.FK_SalesOrderHeader_CurrencyRate_CurrencyRateID", "CurrencyRate").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<CurrencyRate>("AdventureWorksModel.FK_SalesOrderHeader_CurrencyRate_CurrencyRateID", "CurrencyRate").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<CurrencyRate> CurrencyRateReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<CurrencyRate>("AdventureWorksModel.FK_SalesOrderHeader_CurrencyRate_CurrencyRateID", "CurrencyRate");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<CurrencyRate>("AdventureWorksModel.FK_SalesOrderHeader_CurrencyRate_CurrencyRateID", "CurrencyRate", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Customer_CustomerID", "Customer")]
        public Customer Customer
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Customer>("AdventureWorksModel.FK_SalesOrderHeader_Customer_CustomerID", "Customer").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Customer>("AdventureWorksModel.FK_SalesOrderHeader_Customer_CustomerID", "Customer").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Customer> CustomerReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Customer>("AdventureWorksModel.FK_SalesOrderHeader_Customer_CustomerID", "Customer");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Customer>("AdventureWorksModel.FK_SalesOrderHeader_Customer_CustomerID", "Customer", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderDetail")]
        public EntityCollection<SalesOrderDetail> SalesOrderDetails
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<SalesOrderDetail>("AdventureWorksModel.FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderDetail");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<SalesOrderDetail>("AdventureWorksModel.FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderDetail", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_SalesPerson_SalesPersonID", "SalesPerson")]
        public SalesPerson SalesPerson
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesPerson>("AdventureWorksModel.FK_SalesOrderHeader_SalesPerson_SalesPersonID", "SalesPerson").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesPerson>("AdventureWorksModel.FK_SalesOrderHeader_SalesPerson_SalesPersonID", "SalesPerson").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<SalesPerson> SalesPersonReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesPerson>("AdventureWorksModel.FK_SalesOrderHeader_SalesPerson_SalesPersonID", "SalesPerson");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<SalesPerson>("AdventureWorksModel.FK_SalesOrderHeader_SalesPerson_SalesPersonID", "SalesPerson", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_SalesTerritory_TerritoryID", "SalesTerritory")]
        public SalesTerritory SalesTerritory
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesTerritory>("AdventureWorksModel.FK_SalesOrderHeader_SalesTerritory_TerritoryID", "SalesTerritory").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesTerritory>("AdventureWorksModel.FK_SalesOrderHeader_SalesTerritory_TerritoryID", "SalesTerritory").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<SalesTerritory> SalesTerritoryReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesTerritory>("AdventureWorksModel.FK_SalesOrderHeader_SalesTerritory_TerritoryID", "SalesTerritory");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<SalesTerritory>("AdventureWorksModel.FK_SalesOrderHeader_SalesTerritory_TerritoryID", "SalesTerritory", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID", "SalesOrderHeaderSalesReason")]
        public EntityCollection<SalesOrderHeaderSalesReason> SalesOrderHeaderSalesReasons
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<SalesOrderHeaderSalesReason>("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID", "SalesOrderHeaderSalesReason");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<SalesOrderHeaderSalesReason>("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID", "SalesOrderHeaderSalesReason", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="SalesOrderHeaderSalesReason")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class SalesOrderHeaderSalesReason : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new SalesOrderHeaderSalesReason object.
        /// </summary>
        /// <param name="salesOrderID">Initial value of the SalesOrderID property.</param>
        /// <param name="salesReasonID">Initial value of the SalesReasonID property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static SalesOrderHeaderSalesReason CreateSalesOrderHeaderSalesReason(global::System.Int32 salesOrderID, global::System.Int32 salesReasonID, global::System.DateTime modifiedDate)
        {
            SalesOrderHeaderSalesReason salesOrderHeaderSalesReason = new SalesOrderHeaderSalesReason();
            salesOrderHeaderSalesReason.SalesOrderID = salesOrderID;
            salesOrderHeaderSalesReason.SalesReasonID = salesReasonID;
            salesOrderHeaderSalesReason.ModifiedDate = modifiedDate;
            return salesOrderHeaderSalesReason;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 SalesOrderID
        {
            get
            {
                return _SalesOrderID;
            }
            set
            {
                if (_SalesOrderID != value)
                {
                    OnSalesOrderIDChanging(value);
                    ReportPropertyChanging("SalesOrderID");
                    _SalesOrderID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("SalesOrderID");
                    OnSalesOrderIDChanged();
                }
            }
        }
        private global::System.Int32 _SalesOrderID;
        partial void OnSalesOrderIDChanging(global::System.Int32 value);
        partial void OnSalesOrderIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 SalesReasonID
        {
            get
            {
                return _SalesReasonID;
            }
            set
            {
                if (_SalesReasonID != value)
                {
                    OnSalesReasonIDChanging(value);
                    ReportPropertyChanging("SalesReasonID");
                    _SalesReasonID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("SalesReasonID");
                    OnSalesReasonIDChanged();
                }
            }
        }
        private global::System.Int32 _SalesReasonID;
        partial void OnSalesReasonIDChanging(global::System.Int32 value);
        partial void OnSalesReasonIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID", "SalesOrderHeader")]
        public SalesOrderHeader SalesOrderHeader
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesOrderHeader>("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID", "SalesOrderHeader").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesOrderHeader>("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID", "SalesOrderHeader").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<SalesOrderHeader> SalesOrderHeaderReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesOrderHeader>("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID", "SalesOrderHeader");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<SalesOrderHeader>("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID", "SalesOrderHeader", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID", "SalesReason")]
        public SalesReason SalesReason
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesReason>("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID", "SalesReason").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesReason>("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID", "SalesReason").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<SalesReason> SalesReasonReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesReason>("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID", "SalesReason");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<SalesReason>("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID", "SalesReason", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="SalesPerson")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class SalesPerson : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new SalesPerson object.
        /// </summary>
        /// <param name="salesPersonID">Initial value of the SalesPersonID property.</param>
        /// <param name="bonus">Initial value of the Bonus property.</param>
        /// <param name="commissionPct">Initial value of the CommissionPct property.</param>
        /// <param name="salesYTD">Initial value of the SalesYTD property.</param>
        /// <param name="salesLastYear">Initial value of the SalesLastYear property.</param>
        /// <param name="rowguid">Initial value of the rowguid property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static SalesPerson CreateSalesPerson(global::System.Int32 salesPersonID, global::System.Decimal bonus, global::System.Decimal commissionPct, global::System.Decimal salesYTD, global::System.Decimal salesLastYear, global::System.Guid rowguid, global::System.DateTime modifiedDate)
        {
            SalesPerson salesPerson = new SalesPerson();
            salesPerson.SalesPersonID = salesPersonID;
            salesPerson.Bonus = bonus;
            salesPerson.CommissionPct = commissionPct;
            salesPerson.SalesYTD = salesYTD;
            salesPerson.SalesLastYear = salesLastYear;
            salesPerson.rowguid = rowguid;
            salesPerson.ModifiedDate = modifiedDate;
            return salesPerson;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 SalesPersonID
        {
            get
            {
                return _SalesPersonID;
            }
            set
            {
                if (_SalesPersonID != value)
                {
                    OnSalesPersonIDChanging(value);
                    ReportPropertyChanging("SalesPersonID");
                    _SalesPersonID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("SalesPersonID");
                    OnSalesPersonIDChanged();
                }
            }
        }
        private global::System.Int32 _SalesPersonID;
        partial void OnSalesPersonIDChanging(global::System.Int32 value);
        partial void OnSalesPersonIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> TerritoryID
        {
            get
            {
                return _TerritoryID;
            }
            set
            {
                OnTerritoryIDChanging(value);
                ReportPropertyChanging("TerritoryID");
                _TerritoryID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("TerritoryID");
                OnTerritoryIDChanged();
            }
        }
        private Nullable<global::System.Int32> _TerritoryID;
        partial void OnTerritoryIDChanging(Nullable<global::System.Int32> value);
        partial void OnTerritoryIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Decimal> SalesQuota
        {
            get
            {
                return _SalesQuota;
            }
            set
            {
                OnSalesQuotaChanging(value);
                ReportPropertyChanging("SalesQuota");
                _SalesQuota = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("SalesQuota");
                OnSalesQuotaChanged();
            }
        }
        private Nullable<global::System.Decimal> _SalesQuota;
        partial void OnSalesQuotaChanging(Nullable<global::System.Decimal> value);
        partial void OnSalesQuotaChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal Bonus
        {
            get
            {
                return _Bonus;
            }
            set
            {
                OnBonusChanging(value);
                ReportPropertyChanging("Bonus");
                _Bonus = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("Bonus");
                OnBonusChanged();
            }
        }
        private global::System.Decimal _Bonus;
        partial void OnBonusChanging(global::System.Decimal value);
        partial void OnBonusChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal CommissionPct
        {
            get
            {
                return _CommissionPct;
            }
            set
            {
                OnCommissionPctChanging(value);
                ReportPropertyChanging("CommissionPct");
                _CommissionPct = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("CommissionPct");
                OnCommissionPctChanged();
            }
        }
        private global::System.Decimal _CommissionPct;
        partial void OnCommissionPctChanging(global::System.Decimal value);
        partial void OnCommissionPctChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal SalesYTD
        {
            get
            {
                return _SalesYTD;
            }
            set
            {
                OnSalesYTDChanging(value);
                ReportPropertyChanging("SalesYTD");
                _SalesYTD = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("SalesYTD");
                OnSalesYTDChanged();
            }
        }
        private global::System.Decimal _SalesYTD;
        partial void OnSalesYTDChanging(global::System.Decimal value);
        partial void OnSalesYTDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal SalesLastYear
        {
            get
            {
                return _SalesLastYear;
            }
            set
            {
                OnSalesLastYearChanging(value);
                ReportPropertyChanging("SalesLastYear");
                _SalesLastYear = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("SalesLastYear");
                OnSalesLastYearChanged();
            }
        }
        private global::System.Decimal _SalesLastYear;
        partial void OnSalesLastYearChanging(global::System.Decimal value);
        partial void OnSalesLastYearChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Guid rowguid
        {
            get
            {
                return _rowguid;
            }
            set
            {
                OnrowguidChanging(value);
                ReportPropertyChanging("rowguid");
                _rowguid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("rowguid");
                OnrowguidChanged();
            }
        }
        private global::System.Guid _rowguid;
        partial void OnrowguidChanging(global::System.Guid value);
        partial void OnrowguidChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesPerson_Employee_SalesPersonID", "Employee")]
        public Employee Employee
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Employee>("AdventureWorksModel.FK_SalesPerson_Employee_SalesPersonID", "Employee").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Employee>("AdventureWorksModel.FK_SalesPerson_Employee_SalesPersonID", "Employee").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Employee> EmployeeReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Employee>("AdventureWorksModel.FK_SalesPerson_Employee_SalesPersonID", "Employee");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Employee>("AdventureWorksModel.FK_SalesPerson_Employee_SalesPersonID", "Employee", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_SalesPerson_SalesPersonID", "SalesOrderHeader")]
        public EntityCollection<SalesOrderHeader> SalesOrderHeaders
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<SalesOrderHeader>("AdventureWorksModel.FK_SalesOrderHeader_SalesPerson_SalesPersonID", "SalesOrderHeader");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<SalesOrderHeader>("AdventureWorksModel.FK_SalesOrderHeader_SalesPerson_SalesPersonID", "SalesOrderHeader", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesPerson_SalesTerritory_TerritoryID", "SalesTerritory")]
        public SalesTerritory SalesTerritory
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesTerritory>("AdventureWorksModel.FK_SalesPerson_SalesTerritory_TerritoryID", "SalesTerritory").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesTerritory>("AdventureWorksModel.FK_SalesPerson_SalesTerritory_TerritoryID", "SalesTerritory").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<SalesTerritory> SalesTerritoryReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesTerritory>("AdventureWorksModel.FK_SalesPerson_SalesTerritory_TerritoryID", "SalesTerritory");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<SalesTerritory>("AdventureWorksModel.FK_SalesPerson_SalesTerritory_TerritoryID", "SalesTerritory", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesPersonQuotaHistory_SalesPerson_SalesPersonID", "SalesPersonQuotaHistory")]
        public EntityCollection<SalesPersonQuotaHistory> SalesPersonQuotaHistories
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<SalesPersonQuotaHistory>("AdventureWorksModel.FK_SalesPersonQuotaHistory_SalesPerson_SalesPersonID", "SalesPersonQuotaHistory");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<SalesPersonQuotaHistory>("AdventureWorksModel.FK_SalesPersonQuotaHistory_SalesPerson_SalesPersonID", "SalesPersonQuotaHistory", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesTerritoryHistory_SalesPerson_SalesPersonID", "SalesTerritoryHistory")]
        public EntityCollection<SalesTerritoryHistory> SalesTerritoryHistories
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<SalesTerritoryHistory>("AdventureWorksModel.FK_SalesTerritoryHistory_SalesPerson_SalesPersonID", "SalesTerritoryHistory");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<SalesTerritoryHistory>("AdventureWorksModel.FK_SalesTerritoryHistory_SalesPerson_SalesPersonID", "SalesTerritoryHistory", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_Store_SalesPerson_SalesPersonID", "Store")]
        public EntityCollection<Store> Stores
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<Store>("AdventureWorksModel.FK_Store_SalesPerson_SalesPersonID", "Store");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<Store>("AdventureWorksModel.FK_Store_SalesPerson_SalesPersonID", "Store", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="SalesPersonQuotaHistory")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class SalesPersonQuotaHistory : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new SalesPersonQuotaHistory object.
        /// </summary>
        /// <param name="salesPersonID">Initial value of the SalesPersonID property.</param>
        /// <param name="quotaDate">Initial value of the QuotaDate property.</param>
        /// <param name="salesQuota">Initial value of the SalesQuota property.</param>
        /// <param name="rowguid">Initial value of the rowguid property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static SalesPersonQuotaHistory CreateSalesPersonQuotaHistory(global::System.Int32 salesPersonID, global::System.DateTime quotaDate, global::System.Decimal salesQuota, global::System.Guid rowguid, global::System.DateTime modifiedDate)
        {
            SalesPersonQuotaHistory salesPersonQuotaHistory = new SalesPersonQuotaHistory();
            salesPersonQuotaHistory.SalesPersonID = salesPersonID;
            salesPersonQuotaHistory.QuotaDate = quotaDate;
            salesPersonQuotaHistory.SalesQuota = salesQuota;
            salesPersonQuotaHistory.rowguid = rowguid;
            salesPersonQuotaHistory.ModifiedDate = modifiedDate;
            return salesPersonQuotaHistory;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 SalesPersonID
        {
            get
            {
                return _SalesPersonID;
            }
            set
            {
                if (_SalesPersonID != value)
                {
                    OnSalesPersonIDChanging(value);
                    ReportPropertyChanging("SalesPersonID");
                    _SalesPersonID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("SalesPersonID");
                    OnSalesPersonIDChanged();
                }
            }
        }
        private global::System.Int32 _SalesPersonID;
        partial void OnSalesPersonIDChanging(global::System.Int32 value);
        partial void OnSalesPersonIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime QuotaDate
        {
            get
            {
                return _QuotaDate;
            }
            set
            {
                if (_QuotaDate != value)
                {
                    OnQuotaDateChanging(value);
                    ReportPropertyChanging("QuotaDate");
                    _QuotaDate = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("QuotaDate");
                    OnQuotaDateChanged();
                }
            }
        }
        private global::System.DateTime _QuotaDate;
        partial void OnQuotaDateChanging(global::System.DateTime value);
        partial void OnQuotaDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal SalesQuota
        {
            get
            {
                return _SalesQuota;
            }
            set
            {
                OnSalesQuotaChanging(value);
                ReportPropertyChanging("SalesQuota");
                _SalesQuota = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("SalesQuota");
                OnSalesQuotaChanged();
            }
        }
        private global::System.Decimal _SalesQuota;
        partial void OnSalesQuotaChanging(global::System.Decimal value);
        partial void OnSalesQuotaChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Guid rowguid
        {
            get
            {
                return _rowguid;
            }
            set
            {
                OnrowguidChanging(value);
                ReportPropertyChanging("rowguid");
                _rowguid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("rowguid");
                OnrowguidChanged();
            }
        }
        private global::System.Guid _rowguid;
        partial void OnrowguidChanging(global::System.Guid value);
        partial void OnrowguidChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesPersonQuotaHistory_SalesPerson_SalesPersonID", "SalesPerson")]
        public SalesPerson SalesPerson
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesPerson>("AdventureWorksModel.FK_SalesPersonQuotaHistory_SalesPerson_SalesPersonID", "SalesPerson").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesPerson>("AdventureWorksModel.FK_SalesPersonQuotaHistory_SalesPerson_SalesPersonID", "SalesPerson").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<SalesPerson> SalesPersonReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesPerson>("AdventureWorksModel.FK_SalesPersonQuotaHistory_SalesPerson_SalesPersonID", "SalesPerson");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<SalesPerson>("AdventureWorksModel.FK_SalesPersonQuotaHistory_SalesPerson_SalesPersonID", "SalesPerson", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="SalesReason")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class SalesReason : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new SalesReason object.
        /// </summary>
        /// <param name="salesReasonID">Initial value of the SalesReasonID property.</param>
        /// <param name="name">Initial value of the Name property.</param>
        /// <param name="reasonType">Initial value of the ReasonType property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static SalesReason CreateSalesReason(global::System.Int32 salesReasonID, global::System.String name, global::System.String reasonType, global::System.DateTime modifiedDate)
        {
            SalesReason salesReason = new SalesReason();
            salesReason.SalesReasonID = salesReasonID;
            salesReason.Name = name;
            salesReason.ReasonType = reasonType;
            salesReason.ModifiedDate = modifiedDate;
            return salesReason;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 SalesReasonID
        {
            get
            {
                return _SalesReasonID;
            }
            set
            {
                if (_SalesReasonID != value)
                {
                    OnSalesReasonIDChanging(value);
                    ReportPropertyChanging("SalesReasonID");
                    _SalesReasonID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("SalesReasonID");
                    OnSalesReasonIDChanged();
                }
            }
        }
        private global::System.Int32 _SalesReasonID;
        partial void OnSalesReasonIDChanging(global::System.Int32 value);
        partial void OnSalesReasonIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Name
        {
            get
            {
                return _Name;
            }
            set
            {
                OnNameChanging(value);
                ReportPropertyChanging("Name");
                _Name = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Name");
                OnNameChanged();
            }
        }
        private global::System.String _Name;
        partial void OnNameChanging(global::System.String value);
        partial void OnNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String ReasonType
        {
            get
            {
                return _ReasonType;
            }
            set
            {
                OnReasonTypeChanging(value);
                ReportPropertyChanging("ReasonType");
                _ReasonType = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("ReasonType");
                OnReasonTypeChanged();
            }
        }
        private global::System.String _ReasonType;
        partial void OnReasonTypeChanging(global::System.String value);
        partial void OnReasonTypeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID", "SalesOrderHeaderSalesReason")]
        public EntityCollection<SalesOrderHeaderSalesReason> SalesOrderHeaderSalesReasons
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<SalesOrderHeaderSalesReason>("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID", "SalesOrderHeaderSalesReason");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<SalesOrderHeaderSalesReason>("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID", "SalesOrderHeaderSalesReason", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="SalesTaxRate")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class SalesTaxRate : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new SalesTaxRate object.
        /// </summary>
        /// <param name="salesTaxRateID">Initial value of the SalesTaxRateID property.</param>
        /// <param name="stateProvinceID">Initial value of the StateProvinceID property.</param>
        /// <param name="taxType">Initial value of the TaxType property.</param>
        /// <param name="taxRate">Initial value of the TaxRate property.</param>
        /// <param name="name">Initial value of the Name property.</param>
        /// <param name="rowguid">Initial value of the rowguid property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static SalesTaxRate CreateSalesTaxRate(global::System.Int32 salesTaxRateID, global::System.Int32 stateProvinceID, global::System.Byte taxType, global::System.Decimal taxRate, global::System.String name, global::System.Guid rowguid, global::System.DateTime modifiedDate)
        {
            SalesTaxRate salesTaxRate = new SalesTaxRate();
            salesTaxRate.SalesTaxRateID = salesTaxRateID;
            salesTaxRate.StateProvinceID = stateProvinceID;
            salesTaxRate.TaxType = taxType;
            salesTaxRate.TaxRate = taxRate;
            salesTaxRate.Name = name;
            salesTaxRate.rowguid = rowguid;
            salesTaxRate.ModifiedDate = modifiedDate;
            return salesTaxRate;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 SalesTaxRateID
        {
            get
            {
                return _SalesTaxRateID;
            }
            set
            {
                if (_SalesTaxRateID != value)
                {
                    OnSalesTaxRateIDChanging(value);
                    ReportPropertyChanging("SalesTaxRateID");
                    _SalesTaxRateID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("SalesTaxRateID");
                    OnSalesTaxRateIDChanged();
                }
            }
        }
        private global::System.Int32 _SalesTaxRateID;
        partial void OnSalesTaxRateIDChanging(global::System.Int32 value);
        partial void OnSalesTaxRateIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 StateProvinceID
        {
            get
            {
                return _StateProvinceID;
            }
            set
            {
                OnStateProvinceIDChanging(value);
                ReportPropertyChanging("StateProvinceID");
                _StateProvinceID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("StateProvinceID");
                OnStateProvinceIDChanged();
            }
        }
        private global::System.Int32 _StateProvinceID;
        partial void OnStateProvinceIDChanging(global::System.Int32 value);
        partial void OnStateProvinceIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Byte TaxType
        {
            get
            {
                return _TaxType;
            }
            set
            {
                OnTaxTypeChanging(value);
                ReportPropertyChanging("TaxType");
                _TaxType = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("TaxType");
                OnTaxTypeChanged();
            }
        }
        private global::System.Byte _TaxType;
        partial void OnTaxTypeChanging(global::System.Byte value);
        partial void OnTaxTypeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal TaxRate
        {
            get
            {
                return _TaxRate;
            }
            set
            {
                OnTaxRateChanging(value);
                ReportPropertyChanging("TaxRate");
                _TaxRate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("TaxRate");
                OnTaxRateChanged();
            }
        }
        private global::System.Decimal _TaxRate;
        partial void OnTaxRateChanging(global::System.Decimal value);
        partial void OnTaxRateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Name
        {
            get
            {
                return _Name;
            }
            set
            {
                OnNameChanging(value);
                ReportPropertyChanging("Name");
                _Name = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Name");
                OnNameChanged();
            }
        }
        private global::System.String _Name;
        partial void OnNameChanging(global::System.String value);
        partial void OnNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Guid rowguid
        {
            get
            {
                return _rowguid;
            }
            set
            {
                OnrowguidChanging(value);
                ReportPropertyChanging("rowguid");
                _rowguid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("rowguid");
                OnrowguidChanged();
            }
        }
        private global::System.Guid _rowguid;
        partial void OnrowguidChanging(global::System.Guid value);
        partial void OnrowguidChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesTaxRate_StateProvince_StateProvinceID", "StateProvince")]
        public StateProvince StateProvince
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<StateProvince>("AdventureWorksModel.FK_SalesTaxRate_StateProvince_StateProvinceID", "StateProvince").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<StateProvince>("AdventureWorksModel.FK_SalesTaxRate_StateProvince_StateProvinceID", "StateProvince").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<StateProvince> StateProvinceReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<StateProvince>("AdventureWorksModel.FK_SalesTaxRate_StateProvince_StateProvinceID", "StateProvince");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<StateProvince>("AdventureWorksModel.FK_SalesTaxRate_StateProvince_StateProvinceID", "StateProvince", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="SalesTerritory")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class SalesTerritory : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new SalesTerritory object.
        /// </summary>
        /// <param name="territoryID">Initial value of the TerritoryID property.</param>
        /// <param name="name">Initial value of the Name property.</param>
        /// <param name="countryRegionCode">Initial value of the CountryRegionCode property.</param>
        /// <param name="group">Initial value of the Group property.</param>
        /// <param name="salesYTD">Initial value of the SalesYTD property.</param>
        /// <param name="salesLastYear">Initial value of the SalesLastYear property.</param>
        /// <param name="costYTD">Initial value of the CostYTD property.</param>
        /// <param name="costLastYear">Initial value of the CostLastYear property.</param>
        /// <param name="rowguid">Initial value of the rowguid property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static SalesTerritory CreateSalesTerritory(global::System.Int32 territoryID, global::System.String name, global::System.String countryRegionCode, global::System.String group, global::System.Decimal salesYTD, global::System.Decimal salesLastYear, global::System.Decimal costYTD, global::System.Decimal costLastYear, global::System.Guid rowguid, global::System.DateTime modifiedDate)
        {
            SalesTerritory salesTerritory = new SalesTerritory();
            salesTerritory.TerritoryID = territoryID;
            salesTerritory.Name = name;
            salesTerritory.CountryRegionCode = countryRegionCode;
            salesTerritory.Group = group;
            salesTerritory.SalesYTD = salesYTD;
            salesTerritory.SalesLastYear = salesLastYear;
            salesTerritory.CostYTD = costYTD;
            salesTerritory.CostLastYear = costLastYear;
            salesTerritory.rowguid = rowguid;
            salesTerritory.ModifiedDate = modifiedDate;
            return salesTerritory;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 TerritoryID
        {
            get
            {
                return _TerritoryID;
            }
            set
            {
                if (_TerritoryID != value)
                {
                    OnTerritoryIDChanging(value);
                    ReportPropertyChanging("TerritoryID");
                    _TerritoryID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("TerritoryID");
                    OnTerritoryIDChanged();
                }
            }
        }
        private global::System.Int32 _TerritoryID;
        partial void OnTerritoryIDChanging(global::System.Int32 value);
        partial void OnTerritoryIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Name
        {
            get
            {
                return _Name;
            }
            set
            {
                OnNameChanging(value);
                ReportPropertyChanging("Name");
                _Name = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Name");
                OnNameChanged();
            }
        }
        private global::System.String _Name;
        partial void OnNameChanging(global::System.String value);
        partial void OnNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String CountryRegionCode
        {
            get
            {
                return _CountryRegionCode;
            }
            set
            {
                OnCountryRegionCodeChanging(value);
                ReportPropertyChanging("CountryRegionCode");
                _CountryRegionCode = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("CountryRegionCode");
                OnCountryRegionCodeChanged();
            }
        }
        private global::System.String _CountryRegionCode;
        partial void OnCountryRegionCodeChanging(global::System.String value);
        partial void OnCountryRegionCodeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Group
        {
            get
            {
                return _Group;
            }
            set
            {
                OnGroupChanging(value);
                ReportPropertyChanging("Group");
                _Group = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Group");
                OnGroupChanged();
            }
        }
        private global::System.String _Group;
        partial void OnGroupChanging(global::System.String value);
        partial void OnGroupChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal SalesYTD
        {
            get
            {
                return _SalesYTD;
            }
            set
            {
                OnSalesYTDChanging(value);
                ReportPropertyChanging("SalesYTD");
                _SalesYTD = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("SalesYTD");
                OnSalesYTDChanged();
            }
        }
        private global::System.Decimal _SalesYTD;
        partial void OnSalesYTDChanging(global::System.Decimal value);
        partial void OnSalesYTDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal SalesLastYear
        {
            get
            {
                return _SalesLastYear;
            }
            set
            {
                OnSalesLastYearChanging(value);
                ReportPropertyChanging("SalesLastYear");
                _SalesLastYear = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("SalesLastYear");
                OnSalesLastYearChanged();
            }
        }
        private global::System.Decimal _SalesLastYear;
        partial void OnSalesLastYearChanging(global::System.Decimal value);
        partial void OnSalesLastYearChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal CostYTD
        {
            get
            {
                return _CostYTD;
            }
            set
            {
                OnCostYTDChanging(value);
                ReportPropertyChanging("CostYTD");
                _CostYTD = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("CostYTD");
                OnCostYTDChanged();
            }
        }
        private global::System.Decimal _CostYTD;
        partial void OnCostYTDChanging(global::System.Decimal value);
        partial void OnCostYTDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal CostLastYear
        {
            get
            {
                return _CostLastYear;
            }
            set
            {
                OnCostLastYearChanging(value);
                ReportPropertyChanging("CostLastYear");
                _CostLastYear = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("CostLastYear");
                OnCostLastYearChanged();
            }
        }
        private global::System.Decimal _CostLastYear;
        partial void OnCostLastYearChanging(global::System.Decimal value);
        partial void OnCostLastYearChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Guid rowguid
        {
            get
            {
                return _rowguid;
            }
            set
            {
                OnrowguidChanging(value);
                ReportPropertyChanging("rowguid");
                _rowguid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("rowguid");
                OnrowguidChanged();
            }
        }
        private global::System.Guid _rowguid;
        partial void OnrowguidChanging(global::System.Guid value);
        partial void OnrowguidChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_StateProvince_SalesTerritory_TerritoryID", "StateProvince")]
        public EntityCollection<StateProvince> StateProvinces
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<StateProvince>("AdventureWorksModel.FK_StateProvince_SalesTerritory_TerritoryID", "StateProvince");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<StateProvince>("AdventureWorksModel.FK_StateProvince_SalesTerritory_TerritoryID", "StateProvince", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_Customer_SalesTerritory_TerritoryID", "Customer")]
        public EntityCollection<Customer> Customers
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<Customer>("AdventureWorksModel.FK_Customer_SalesTerritory_TerritoryID", "Customer");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<Customer>("AdventureWorksModel.FK_Customer_SalesTerritory_TerritoryID", "Customer", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_SalesTerritory_TerritoryID", "SalesOrderHeader")]
        public EntityCollection<SalesOrderHeader> SalesOrderHeaders
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<SalesOrderHeader>("AdventureWorksModel.FK_SalesOrderHeader_SalesTerritory_TerritoryID", "SalesOrderHeader");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<SalesOrderHeader>("AdventureWorksModel.FK_SalesOrderHeader_SalesTerritory_TerritoryID", "SalesOrderHeader", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesPerson_SalesTerritory_TerritoryID", "SalesPerson")]
        public EntityCollection<SalesPerson> SalesPersons
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<SalesPerson>("AdventureWorksModel.FK_SalesPerson_SalesTerritory_TerritoryID", "SalesPerson");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<SalesPerson>("AdventureWorksModel.FK_SalesPerson_SalesTerritory_TerritoryID", "SalesPerson", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesTerritoryHistory_SalesTerritory_TerritoryID", "SalesTerritoryHistory")]
        public EntityCollection<SalesTerritoryHistory> SalesTerritoryHistories
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<SalesTerritoryHistory>("AdventureWorksModel.FK_SalesTerritoryHistory_SalesTerritory_TerritoryID", "SalesTerritoryHistory");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<SalesTerritoryHistory>("AdventureWorksModel.FK_SalesTerritoryHistory_SalesTerritory_TerritoryID", "SalesTerritoryHistory", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="SalesTerritoryHistory")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class SalesTerritoryHistory : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new SalesTerritoryHistory object.
        /// </summary>
        /// <param name="salesPersonID">Initial value of the SalesPersonID property.</param>
        /// <param name="territoryID">Initial value of the TerritoryID property.</param>
        /// <param name="startDate">Initial value of the StartDate property.</param>
        /// <param name="rowguid">Initial value of the rowguid property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static SalesTerritoryHistory CreateSalesTerritoryHistory(global::System.Int32 salesPersonID, global::System.Int32 territoryID, global::System.DateTime startDate, global::System.Guid rowguid, global::System.DateTime modifiedDate)
        {
            SalesTerritoryHistory salesTerritoryHistory = new SalesTerritoryHistory();
            salesTerritoryHistory.SalesPersonID = salesPersonID;
            salesTerritoryHistory.TerritoryID = territoryID;
            salesTerritoryHistory.StartDate = startDate;
            salesTerritoryHistory.rowguid = rowguid;
            salesTerritoryHistory.ModifiedDate = modifiedDate;
            return salesTerritoryHistory;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 SalesPersonID
        {
            get
            {
                return _SalesPersonID;
            }
            set
            {
                if (_SalesPersonID != value)
                {
                    OnSalesPersonIDChanging(value);
                    ReportPropertyChanging("SalesPersonID");
                    _SalesPersonID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("SalesPersonID");
                    OnSalesPersonIDChanged();
                }
            }
        }
        private global::System.Int32 _SalesPersonID;
        partial void OnSalesPersonIDChanging(global::System.Int32 value);
        partial void OnSalesPersonIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 TerritoryID
        {
            get
            {
                return _TerritoryID;
            }
            set
            {
                if (_TerritoryID != value)
                {
                    OnTerritoryIDChanging(value);
                    ReportPropertyChanging("TerritoryID");
                    _TerritoryID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("TerritoryID");
                    OnTerritoryIDChanged();
                }
            }
        }
        private global::System.Int32 _TerritoryID;
        partial void OnTerritoryIDChanging(global::System.Int32 value);
        partial void OnTerritoryIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime StartDate
        {
            get
            {
                return _StartDate;
            }
            set
            {
                if (_StartDate != value)
                {
                    OnStartDateChanging(value);
                    ReportPropertyChanging("StartDate");
                    _StartDate = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("StartDate");
                    OnStartDateChanged();
                }
            }
        }
        private global::System.DateTime _StartDate;
        partial void OnStartDateChanging(global::System.DateTime value);
        partial void OnStartDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.DateTime> EndDate
        {
            get
            {
                return _EndDate;
            }
            set
            {
                OnEndDateChanging(value);
                ReportPropertyChanging("EndDate");
                _EndDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("EndDate");
                OnEndDateChanged();
            }
        }
        private Nullable<global::System.DateTime> _EndDate;
        partial void OnEndDateChanging(Nullable<global::System.DateTime> value);
        partial void OnEndDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Guid rowguid
        {
            get
            {
                return _rowguid;
            }
            set
            {
                OnrowguidChanging(value);
                ReportPropertyChanging("rowguid");
                _rowguid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("rowguid");
                OnrowguidChanged();
            }
        }
        private global::System.Guid _rowguid;
        partial void OnrowguidChanging(global::System.Guid value);
        partial void OnrowguidChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesTerritoryHistory_SalesPerson_SalesPersonID", "SalesPerson")]
        public SalesPerson SalesPerson
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesPerson>("AdventureWorksModel.FK_SalesTerritoryHistory_SalesPerson_SalesPersonID", "SalesPerson").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesPerson>("AdventureWorksModel.FK_SalesTerritoryHistory_SalesPerson_SalesPersonID", "SalesPerson").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<SalesPerson> SalesPersonReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesPerson>("AdventureWorksModel.FK_SalesTerritoryHistory_SalesPerson_SalesPersonID", "SalesPerson");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<SalesPerson>("AdventureWorksModel.FK_SalesTerritoryHistory_SalesPerson_SalesPersonID", "SalesPerson", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesTerritoryHistory_SalesTerritory_TerritoryID", "SalesTerritory")]
        public SalesTerritory SalesTerritory
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesTerritory>("AdventureWorksModel.FK_SalesTerritoryHistory_SalesTerritory_TerritoryID", "SalesTerritory").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesTerritory>("AdventureWorksModel.FK_SalesTerritoryHistory_SalesTerritory_TerritoryID", "SalesTerritory").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<SalesTerritory> SalesTerritoryReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesTerritory>("AdventureWorksModel.FK_SalesTerritoryHistory_SalesTerritory_TerritoryID", "SalesTerritory");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<SalesTerritory>("AdventureWorksModel.FK_SalesTerritoryHistory_SalesTerritory_TerritoryID", "SalesTerritory", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="ScrapReason")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class ScrapReason : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new ScrapReason object.
        /// </summary>
        /// <param name="scrapReasonID">Initial value of the ScrapReasonID property.</param>
        /// <param name="name">Initial value of the Name property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static ScrapReason CreateScrapReason(global::System.Int16 scrapReasonID, global::System.String name, global::System.DateTime modifiedDate)
        {
            ScrapReason scrapReason = new ScrapReason();
            scrapReason.ScrapReasonID = scrapReasonID;
            scrapReason.Name = name;
            scrapReason.ModifiedDate = modifiedDate;
            return scrapReason;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int16 ScrapReasonID
        {
            get
            {
                return _ScrapReasonID;
            }
            set
            {
                if (_ScrapReasonID != value)
                {
                    OnScrapReasonIDChanging(value);
                    ReportPropertyChanging("ScrapReasonID");
                    _ScrapReasonID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ScrapReasonID");
                    OnScrapReasonIDChanged();
                }
            }
        }
        private global::System.Int16 _ScrapReasonID;
        partial void OnScrapReasonIDChanging(global::System.Int16 value);
        partial void OnScrapReasonIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Name
        {
            get
            {
                return _Name;
            }
            set
            {
                OnNameChanging(value);
                ReportPropertyChanging("Name");
                _Name = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Name");
                OnNameChanged();
            }
        }
        private global::System.String _Name;
        partial void OnNameChanging(global::System.String value);
        partial void OnNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_WorkOrder_ScrapReason_ScrapReasonID", "WorkOrder")]
        public EntityCollection<WorkOrder> WorkOrders
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<WorkOrder>("AdventureWorksModel.FK_WorkOrder_ScrapReason_ScrapReasonID", "WorkOrder");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<WorkOrder>("AdventureWorksModel.FK_WorkOrder_ScrapReason_ScrapReasonID", "WorkOrder", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="Shift")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class Shift : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new Shift object.
        /// </summary>
        /// <param name="shiftID">Initial value of the ShiftID property.</param>
        /// <param name="name">Initial value of the Name property.</param>
        /// <param name="startTime">Initial value of the StartTime property.</param>
        /// <param name="endTime">Initial value of the EndTime property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static Shift CreateShift(global::System.Byte shiftID, global::System.String name, global::System.DateTime startTime, global::System.DateTime endTime, global::System.DateTime modifiedDate)
        {
            Shift shift = new Shift();
            shift.ShiftID = shiftID;
            shift.Name = name;
            shift.StartTime = startTime;
            shift.EndTime = endTime;
            shift.ModifiedDate = modifiedDate;
            return shift;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Byte ShiftID
        {
            get
            {
                return _ShiftID;
            }
            set
            {
                if (_ShiftID != value)
                {
                    OnShiftIDChanging(value);
                    ReportPropertyChanging("ShiftID");
                    _ShiftID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ShiftID");
                    OnShiftIDChanged();
                }
            }
        }
        private global::System.Byte _ShiftID;
        partial void OnShiftIDChanging(global::System.Byte value);
        partial void OnShiftIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Name
        {
            get
            {
                return _Name;
            }
            set
            {
                OnNameChanging(value);
                ReportPropertyChanging("Name");
                _Name = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Name");
                OnNameChanged();
            }
        }
        private global::System.String _Name;
        partial void OnNameChanging(global::System.String value);
        partial void OnNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime StartTime
        {
            get
            {
                return _StartTime;
            }
            set
            {
                OnStartTimeChanging(value);
                ReportPropertyChanging("StartTime");
                _StartTime = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("StartTime");
                OnStartTimeChanged();
            }
        }
        private global::System.DateTime _StartTime;
        partial void OnStartTimeChanging(global::System.DateTime value);
        partial void OnStartTimeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime EndTime
        {
            get
            {
                return _EndTime;
            }
            set
            {
                OnEndTimeChanging(value);
                ReportPropertyChanging("EndTime");
                _EndTime = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("EndTime");
                OnEndTimeChanged();
            }
        }
        private global::System.DateTime _EndTime;
        partial void OnEndTimeChanging(global::System.DateTime value);
        partial void OnEndTimeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_EmployeeDepartmentHistory_Shift_ShiftID", "EmployeeDepartmentHistory")]
        public EntityCollection<EmployeeDepartmentHistory> EmployeeDepartmentHistories
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<EmployeeDepartmentHistory>("AdventureWorksModel.FK_EmployeeDepartmentHistory_Shift_ShiftID", "EmployeeDepartmentHistory");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<EmployeeDepartmentHistory>("AdventureWorksModel.FK_EmployeeDepartmentHistory_Shift_ShiftID", "EmployeeDepartmentHistory", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="ShipMethod")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class ShipMethod : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new ShipMethod object.
        /// </summary>
        /// <param name="shipMethodID">Initial value of the ShipMethodID property.</param>
        /// <param name="name">Initial value of the Name property.</param>
        /// <param name="shipBase">Initial value of the ShipBase property.</param>
        /// <param name="shipRate">Initial value of the ShipRate property.</param>
        /// <param name="rowguid">Initial value of the rowguid property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static ShipMethod CreateShipMethod(global::System.Int32 shipMethodID, global::System.String name, global::System.Decimal shipBase, global::System.Decimal shipRate, global::System.Guid rowguid, global::System.DateTime modifiedDate)
        {
            ShipMethod shipMethod = new ShipMethod();
            shipMethod.ShipMethodID = shipMethodID;
            shipMethod.Name = name;
            shipMethod.ShipBase = shipBase;
            shipMethod.ShipRate = shipRate;
            shipMethod.rowguid = rowguid;
            shipMethod.ModifiedDate = modifiedDate;
            return shipMethod;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ShipMethodID
        {
            get
            {
                return _ShipMethodID;
            }
            set
            {
                if (_ShipMethodID != value)
                {
                    OnShipMethodIDChanging(value);
                    ReportPropertyChanging("ShipMethodID");
                    _ShipMethodID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ShipMethodID");
                    OnShipMethodIDChanged();
                }
            }
        }
        private global::System.Int32 _ShipMethodID;
        partial void OnShipMethodIDChanging(global::System.Int32 value);
        partial void OnShipMethodIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Name
        {
            get
            {
                return _Name;
            }
            set
            {
                OnNameChanging(value);
                ReportPropertyChanging("Name");
                _Name = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Name");
                OnNameChanged();
            }
        }
        private global::System.String _Name;
        partial void OnNameChanging(global::System.String value);
        partial void OnNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal ShipBase
        {
            get
            {
                return _ShipBase;
            }
            set
            {
                OnShipBaseChanging(value);
                ReportPropertyChanging("ShipBase");
                _ShipBase = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ShipBase");
                OnShipBaseChanged();
            }
        }
        private global::System.Decimal _ShipBase;
        partial void OnShipBaseChanging(global::System.Decimal value);
        partial void OnShipBaseChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal ShipRate
        {
            get
            {
                return _ShipRate;
            }
            set
            {
                OnShipRateChanging(value);
                ReportPropertyChanging("ShipRate");
                _ShipRate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ShipRate");
                OnShipRateChanged();
            }
        }
        private global::System.Decimal _ShipRate;
        partial void OnShipRateChanging(global::System.Decimal value);
        partial void OnShipRateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Guid rowguid
        {
            get
            {
                return _rowguid;
            }
            set
            {
                OnrowguidChanging(value);
                ReportPropertyChanging("rowguid");
                _rowguid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("rowguid");
                OnrowguidChanged();
            }
        }
        private global::System.Guid _rowguid;
        partial void OnrowguidChanging(global::System.Guid value);
        partial void OnrowguidChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_PurchaseOrderHeader_ShipMethod_ShipMethodID", "PurchaseOrderHeader")]
        public EntityCollection<PurchaseOrderHeader> PurchaseOrderHeaders
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<PurchaseOrderHeader>("AdventureWorksModel.FK_PurchaseOrderHeader_ShipMethod_ShipMethodID", "PurchaseOrderHeader");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<PurchaseOrderHeader>("AdventureWorksModel.FK_PurchaseOrderHeader_ShipMethod_ShipMethodID", "PurchaseOrderHeader", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_ShipMethod_ShipMethodID", "SalesOrderHeader")]
        public EntityCollection<SalesOrderHeader> SalesOrderHeaders
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<SalesOrderHeader>("AdventureWorksModel.FK_SalesOrderHeader_ShipMethod_ShipMethodID", "SalesOrderHeader");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<SalesOrderHeader>("AdventureWorksModel.FK_SalesOrderHeader_ShipMethod_ShipMethodID", "SalesOrderHeader", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="ShoppingCartItem")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class ShoppingCartItem : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new ShoppingCartItem object.
        /// </summary>
        /// <param name="shoppingCartItemID">Initial value of the ShoppingCartItemID property.</param>
        /// <param name="shoppingCartID">Initial value of the ShoppingCartID property.</param>
        /// <param name="quantity">Initial value of the Quantity property.</param>
        /// <param name="productID">Initial value of the ProductID property.</param>
        /// <param name="dateCreated">Initial value of the DateCreated property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static ShoppingCartItem CreateShoppingCartItem(global::System.Int32 shoppingCartItemID, global::System.String shoppingCartID, global::System.Int32 quantity, global::System.Int32 productID, global::System.DateTime dateCreated, global::System.DateTime modifiedDate)
        {
            ShoppingCartItem shoppingCartItem = new ShoppingCartItem();
            shoppingCartItem.ShoppingCartItemID = shoppingCartItemID;
            shoppingCartItem.ShoppingCartID = shoppingCartID;
            shoppingCartItem.Quantity = quantity;
            shoppingCartItem.ProductID = productID;
            shoppingCartItem.DateCreated = dateCreated;
            shoppingCartItem.ModifiedDate = modifiedDate;
            return shoppingCartItem;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ShoppingCartItemID
        {
            get
            {
                return _ShoppingCartItemID;
            }
            set
            {
                if (_ShoppingCartItemID != value)
                {
                    OnShoppingCartItemIDChanging(value);
                    ReportPropertyChanging("ShoppingCartItemID");
                    _ShoppingCartItemID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ShoppingCartItemID");
                    OnShoppingCartItemIDChanged();
                }
            }
        }
        private global::System.Int32 _ShoppingCartItemID;
        partial void OnShoppingCartItemIDChanging(global::System.Int32 value);
        partial void OnShoppingCartItemIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String ShoppingCartID
        {
            get
            {
                return _ShoppingCartID;
            }
            set
            {
                OnShoppingCartIDChanging(value);
                ReportPropertyChanging("ShoppingCartID");
                _ShoppingCartID = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("ShoppingCartID");
                OnShoppingCartIDChanged();
            }
        }
        private global::System.String _ShoppingCartID;
        partial void OnShoppingCartIDChanging(global::System.String value);
        partial void OnShoppingCartIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 Quantity
        {
            get
            {
                return _Quantity;
            }
            set
            {
                OnQuantityChanging(value);
                ReportPropertyChanging("Quantity");
                _Quantity = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("Quantity");
                OnQuantityChanged();
            }
        }
        private global::System.Int32 _Quantity;
        partial void OnQuantityChanging(global::System.Int32 value);
        partial void OnQuantityChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ProductID
        {
            get
            {
                return _ProductID;
            }
            set
            {
                OnProductIDChanging(value);
                ReportPropertyChanging("ProductID");
                _ProductID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ProductID");
                OnProductIDChanged();
            }
        }
        private global::System.Int32 _ProductID;
        partial void OnProductIDChanging(global::System.Int32 value);
        partial void OnProductIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime DateCreated
        {
            get
            {
                return _DateCreated;
            }
            set
            {
                OnDateCreatedChanging(value);
                ReportPropertyChanging("DateCreated");
                _DateCreated = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("DateCreated");
                OnDateCreatedChanged();
            }
        }
        private global::System.DateTime _DateCreated;
        partial void OnDateCreatedChanging(global::System.DateTime value);
        partial void OnDateCreatedChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ShoppingCartItem_Product_ProductID", "Product")]
        public Product Product
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_ShoppingCartItem_Product_ProductID", "Product").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_ShoppingCartItem_Product_ProductID", "Product").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Product> ProductReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_ShoppingCartItem_Product_ProductID", "Product");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Product>("AdventureWorksModel.FK_ShoppingCartItem_Product_ProductID", "Product", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="SpecialOffer")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class SpecialOffer : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new SpecialOffer object.
        /// </summary>
        /// <param name="specialOfferID">Initial value of the SpecialOfferID property.</param>
        /// <param name="description">Initial value of the Description property.</param>
        /// <param name="discountPct">Initial value of the DiscountPct property.</param>
        /// <param name="type">Initial value of the Type property.</param>
        /// <param name="category">Initial value of the Category property.</param>
        /// <param name="startDate">Initial value of the StartDate property.</param>
        /// <param name="endDate">Initial value of the EndDate property.</param>
        /// <param name="minQty">Initial value of the MinQty property.</param>
        /// <param name="rowguid">Initial value of the rowguid property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static SpecialOffer CreateSpecialOffer(global::System.Int32 specialOfferID, global::System.String description, global::System.Decimal discountPct, global::System.String type, global::System.String category, global::System.DateTime startDate, global::System.DateTime endDate, global::System.Int32 minQty, global::System.Guid rowguid, global::System.DateTime modifiedDate)
        {
            SpecialOffer specialOffer = new SpecialOffer();
            specialOffer.SpecialOfferID = specialOfferID;
            specialOffer.Description = description;
            specialOffer.DiscountPct = discountPct;
            specialOffer.Type = type;
            specialOffer.Category = category;
            specialOffer.StartDate = startDate;
            specialOffer.EndDate = endDate;
            specialOffer.MinQty = minQty;
            specialOffer.rowguid = rowguid;
            specialOffer.ModifiedDate = modifiedDate;
            return specialOffer;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 SpecialOfferID
        {
            get
            {
                return _SpecialOfferID;
            }
            set
            {
                if (_SpecialOfferID != value)
                {
                    OnSpecialOfferIDChanging(value);
                    ReportPropertyChanging("SpecialOfferID");
                    _SpecialOfferID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("SpecialOfferID");
                    OnSpecialOfferIDChanged();
                }
            }
        }
        private global::System.Int32 _SpecialOfferID;
        partial void OnSpecialOfferIDChanging(global::System.Int32 value);
        partial void OnSpecialOfferIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Description
        {
            get
            {
                return _Description;
            }
            set
            {
                OnDescriptionChanging(value);
                ReportPropertyChanging("Description");
                _Description = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Description");
                OnDescriptionChanged();
            }
        }
        private global::System.String _Description;
        partial void OnDescriptionChanging(global::System.String value);
        partial void OnDescriptionChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal DiscountPct
        {
            get
            {
                return _DiscountPct;
            }
            set
            {
                OnDiscountPctChanging(value);
                ReportPropertyChanging("DiscountPct");
                _DiscountPct = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("DiscountPct");
                OnDiscountPctChanged();
            }
        }
        private global::System.Decimal _DiscountPct;
        partial void OnDiscountPctChanging(global::System.Decimal value);
        partial void OnDiscountPctChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Type
        {
            get
            {
                return _Type;
            }
            set
            {
                OnTypeChanging(value);
                ReportPropertyChanging("Type");
                _Type = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Type");
                OnTypeChanged();
            }
        }
        private global::System.String _Type;
        partial void OnTypeChanging(global::System.String value);
        partial void OnTypeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Category
        {
            get
            {
                return _Category;
            }
            set
            {
                OnCategoryChanging(value);
                ReportPropertyChanging("Category");
                _Category = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Category");
                OnCategoryChanged();
            }
        }
        private global::System.String _Category;
        partial void OnCategoryChanging(global::System.String value);
        partial void OnCategoryChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime StartDate
        {
            get
            {
                return _StartDate;
            }
            set
            {
                OnStartDateChanging(value);
                ReportPropertyChanging("StartDate");
                _StartDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("StartDate");
                OnStartDateChanged();
            }
        }
        private global::System.DateTime _StartDate;
        partial void OnStartDateChanging(global::System.DateTime value);
        partial void OnStartDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime EndDate
        {
            get
            {
                return _EndDate;
            }
            set
            {
                OnEndDateChanging(value);
                ReportPropertyChanging("EndDate");
                _EndDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("EndDate");
                OnEndDateChanged();
            }
        }
        private global::System.DateTime _EndDate;
        partial void OnEndDateChanging(global::System.DateTime value);
        partial void OnEndDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 MinQty
        {
            get
            {
                return _MinQty;
            }
            set
            {
                OnMinQtyChanging(value);
                ReportPropertyChanging("MinQty");
                _MinQty = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("MinQty");
                OnMinQtyChanged();
            }
        }
        private global::System.Int32 _MinQty;
        partial void OnMinQtyChanging(global::System.Int32 value);
        partial void OnMinQtyChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> MaxQty
        {
            get
            {
                return _MaxQty;
            }
            set
            {
                OnMaxQtyChanging(value);
                ReportPropertyChanging("MaxQty");
                _MaxQty = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("MaxQty");
                OnMaxQtyChanged();
            }
        }
        private Nullable<global::System.Int32> _MaxQty;
        partial void OnMaxQtyChanging(Nullable<global::System.Int32> value);
        partial void OnMaxQtyChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Guid rowguid
        {
            get
            {
                return _rowguid;
            }
            set
            {
                OnrowguidChanging(value);
                ReportPropertyChanging("rowguid");
                _rowguid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("rowguid");
                OnrowguidChanged();
            }
        }
        private global::System.Guid _rowguid;
        partial void OnrowguidChanging(global::System.Guid value);
        partial void OnrowguidChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID", "SpecialOfferProduct")]
        public EntityCollection<SpecialOfferProduct> SpecialOfferProducts
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<SpecialOfferProduct>("AdventureWorksModel.FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID", "SpecialOfferProduct");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<SpecialOfferProduct>("AdventureWorksModel.FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID", "SpecialOfferProduct", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="SpecialOfferProduct")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class SpecialOfferProduct : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new SpecialOfferProduct object.
        /// </summary>
        /// <param name="specialOfferID">Initial value of the SpecialOfferID property.</param>
        /// <param name="productID">Initial value of the ProductID property.</param>
        /// <param name="rowguid">Initial value of the rowguid property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static SpecialOfferProduct CreateSpecialOfferProduct(global::System.Int32 specialOfferID, global::System.Int32 productID, global::System.Guid rowguid, global::System.DateTime modifiedDate)
        {
            SpecialOfferProduct specialOfferProduct = new SpecialOfferProduct();
            specialOfferProduct.SpecialOfferID = specialOfferID;
            specialOfferProduct.ProductID = productID;
            specialOfferProduct.rowguid = rowguid;
            specialOfferProduct.ModifiedDate = modifiedDate;
            return specialOfferProduct;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 SpecialOfferID
        {
            get
            {
                return _SpecialOfferID;
            }
            set
            {
                if (_SpecialOfferID != value)
                {
                    OnSpecialOfferIDChanging(value);
                    ReportPropertyChanging("SpecialOfferID");
                    _SpecialOfferID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("SpecialOfferID");
                    OnSpecialOfferIDChanged();
                }
            }
        }
        private global::System.Int32 _SpecialOfferID;
        partial void OnSpecialOfferIDChanging(global::System.Int32 value);
        partial void OnSpecialOfferIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ProductID
        {
            get
            {
                return _ProductID;
            }
            set
            {
                if (_ProductID != value)
                {
                    OnProductIDChanging(value);
                    ReportPropertyChanging("ProductID");
                    _ProductID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ProductID");
                    OnProductIDChanged();
                }
            }
        }
        private global::System.Int32 _ProductID;
        partial void OnProductIDChanging(global::System.Int32 value);
        partial void OnProductIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Guid rowguid
        {
            get
            {
                return _rowguid;
            }
            set
            {
                OnrowguidChanging(value);
                ReportPropertyChanging("rowguid");
                _rowguid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("rowguid");
                OnrowguidChanged();
            }
        }
        private global::System.Guid _rowguid;
        partial void OnrowguidChanging(global::System.Guid value);
        partial void OnrowguidChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SpecialOfferProduct_Product_ProductID", "Product")]
        public Product Product
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_SpecialOfferProduct_Product_ProductID", "Product").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_SpecialOfferProduct_Product_ProductID", "Product").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Product> ProductReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_SpecialOfferProduct_Product_ProductID", "Product");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Product>("AdventureWorksModel.FK_SpecialOfferProduct_Product_ProductID", "Product", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID", "SalesOrderDetail")]
        public EntityCollection<SalesOrderDetail> SalesOrderDetails
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<SalesOrderDetail>("AdventureWorksModel.FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID", "SalesOrderDetail");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<SalesOrderDetail>("AdventureWorksModel.FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID", "SalesOrderDetail", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID", "SpecialOffer")]
        public SpecialOffer SpecialOffer
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SpecialOffer>("AdventureWorksModel.FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID", "SpecialOffer").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SpecialOffer>("AdventureWorksModel.FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID", "SpecialOffer").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<SpecialOffer> SpecialOfferReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SpecialOffer>("AdventureWorksModel.FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID", "SpecialOffer");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<SpecialOffer>("AdventureWorksModel.FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID", "SpecialOffer", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="StateProvince")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class StateProvince : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new StateProvince object.
        /// </summary>
        /// <param name="stateProvinceID">Initial value of the StateProvinceID property.</param>
        /// <param name="stateProvinceCode">Initial value of the StateProvinceCode property.</param>
        /// <param name="countryRegionCode">Initial value of the CountryRegionCode property.</param>
        /// <param name="isOnlyStateProvinceFlag">Initial value of the IsOnlyStateProvinceFlag property.</param>
        /// <param name="name">Initial value of the Name property.</param>
        /// <param name="territoryID">Initial value of the TerritoryID property.</param>
        /// <param name="rowguid">Initial value of the rowguid property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static StateProvince CreateStateProvince(global::System.Int32 stateProvinceID, global::System.String stateProvinceCode, global::System.String countryRegionCode, global::System.Boolean isOnlyStateProvinceFlag, global::System.String name, global::System.Int32 territoryID, global::System.Guid rowguid, global::System.DateTime modifiedDate)
        {
            StateProvince stateProvince = new StateProvince();
            stateProvince.StateProvinceID = stateProvinceID;
            stateProvince.StateProvinceCode = stateProvinceCode;
            stateProvince.CountryRegionCode = countryRegionCode;
            stateProvince.IsOnlyStateProvinceFlag = isOnlyStateProvinceFlag;
            stateProvince.Name = name;
            stateProvince.TerritoryID = territoryID;
            stateProvince.rowguid = rowguid;
            stateProvince.ModifiedDate = modifiedDate;
            return stateProvince;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 StateProvinceID
        {
            get
            {
                return _StateProvinceID;
            }
            set
            {
                if (_StateProvinceID != value)
                {
                    OnStateProvinceIDChanging(value);
                    ReportPropertyChanging("StateProvinceID");
                    _StateProvinceID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("StateProvinceID");
                    OnStateProvinceIDChanged();
                }
            }
        }
        private global::System.Int32 _StateProvinceID;
        partial void OnStateProvinceIDChanging(global::System.Int32 value);
        partial void OnStateProvinceIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String StateProvinceCode
        {
            get
            {
                return _StateProvinceCode;
            }
            set
            {
                OnStateProvinceCodeChanging(value);
                ReportPropertyChanging("StateProvinceCode");
                _StateProvinceCode = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("StateProvinceCode");
                OnStateProvinceCodeChanged();
            }
        }
        private global::System.String _StateProvinceCode;
        partial void OnStateProvinceCodeChanging(global::System.String value);
        partial void OnStateProvinceCodeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String CountryRegionCode
        {
            get
            {
                return _CountryRegionCode;
            }
            set
            {
                OnCountryRegionCodeChanging(value);
                ReportPropertyChanging("CountryRegionCode");
                _CountryRegionCode = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("CountryRegionCode");
                OnCountryRegionCodeChanged();
            }
        }
        private global::System.String _CountryRegionCode;
        partial void OnCountryRegionCodeChanging(global::System.String value);
        partial void OnCountryRegionCodeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Boolean IsOnlyStateProvinceFlag
        {
            get
            {
                return _IsOnlyStateProvinceFlag;
            }
            set
            {
                OnIsOnlyStateProvinceFlagChanging(value);
                ReportPropertyChanging("IsOnlyStateProvinceFlag");
                _IsOnlyStateProvinceFlag = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("IsOnlyStateProvinceFlag");
                OnIsOnlyStateProvinceFlagChanged();
            }
        }
        private global::System.Boolean _IsOnlyStateProvinceFlag;
        partial void OnIsOnlyStateProvinceFlagChanging(global::System.Boolean value);
        partial void OnIsOnlyStateProvinceFlagChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Name
        {
            get
            {
                return _Name;
            }
            set
            {
                OnNameChanging(value);
                ReportPropertyChanging("Name");
                _Name = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Name");
                OnNameChanged();
            }
        }
        private global::System.String _Name;
        partial void OnNameChanging(global::System.String value);
        partial void OnNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 TerritoryID
        {
            get
            {
                return _TerritoryID;
            }
            set
            {
                OnTerritoryIDChanging(value);
                ReportPropertyChanging("TerritoryID");
                _TerritoryID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("TerritoryID");
                OnTerritoryIDChanged();
            }
        }
        private global::System.Int32 _TerritoryID;
        partial void OnTerritoryIDChanging(global::System.Int32 value);
        partial void OnTerritoryIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Guid rowguid
        {
            get
            {
                return _rowguid;
            }
            set
            {
                OnrowguidChanging(value);
                ReportPropertyChanging("rowguid");
                _rowguid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("rowguid");
                OnrowguidChanged();
            }
        }
        private global::System.Guid _rowguid;
        partial void OnrowguidChanging(global::System.Guid value);
        partial void OnrowguidChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_Address_StateProvince_StateProvinceID", "Address")]
        public EntityCollection<Address> Addresses
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<Address>("AdventureWorksModel.FK_Address_StateProvince_StateProvinceID", "Address");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<Address>("AdventureWorksModel.FK_Address_StateProvince_StateProvinceID", "Address", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_StateProvince_CountryRegion_CountryRegionCode", "CountryRegion")]
        public CountryRegion CountryRegion
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<CountryRegion>("AdventureWorksModel.FK_StateProvince_CountryRegion_CountryRegionCode", "CountryRegion").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<CountryRegion>("AdventureWorksModel.FK_StateProvince_CountryRegion_CountryRegionCode", "CountryRegion").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<CountryRegion> CountryRegionReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<CountryRegion>("AdventureWorksModel.FK_StateProvince_CountryRegion_CountryRegionCode", "CountryRegion");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<CountryRegion>("AdventureWorksModel.FK_StateProvince_CountryRegion_CountryRegionCode", "CountryRegion", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesTaxRate_StateProvince_StateProvinceID", "SalesTaxRate")]
        public EntityCollection<SalesTaxRate> SalesTaxRates
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<SalesTaxRate>("AdventureWorksModel.FK_SalesTaxRate_StateProvince_StateProvinceID", "SalesTaxRate");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<SalesTaxRate>("AdventureWorksModel.FK_SalesTaxRate_StateProvince_StateProvinceID", "SalesTaxRate", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_StateProvince_SalesTerritory_TerritoryID", "SalesTerritory")]
        public SalesTerritory SalesTerritory
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesTerritory>("AdventureWorksModel.FK_StateProvince_SalesTerritory_TerritoryID", "SalesTerritory").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesTerritory>("AdventureWorksModel.FK_StateProvince_SalesTerritory_TerritoryID", "SalesTerritory").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<SalesTerritory> SalesTerritoryReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesTerritory>("AdventureWorksModel.FK_StateProvince_SalesTerritory_TerritoryID", "SalesTerritory");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<SalesTerritory>("AdventureWorksModel.FK_StateProvince_SalesTerritory_TerritoryID", "SalesTerritory", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="Store")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class Store : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new Store object.
        /// </summary>
        /// <param name="customerID">Initial value of the CustomerID property.</param>
        /// <param name="name">Initial value of the Name property.</param>
        /// <param name="rowguid">Initial value of the rowguid property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static Store CreateStore(global::System.Int32 customerID, global::System.String name, global::System.Guid rowguid, global::System.DateTime modifiedDate)
        {
            Store store = new Store();
            store.CustomerID = customerID;
            store.Name = name;
            store.rowguid = rowguid;
            store.ModifiedDate = modifiedDate;
            return store;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 CustomerID
        {
            get
            {
                return _CustomerID;
            }
            set
            {
                if (_CustomerID != value)
                {
                    OnCustomerIDChanging(value);
                    ReportPropertyChanging("CustomerID");
                    _CustomerID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("CustomerID");
                    OnCustomerIDChanged();
                }
            }
        }
        private global::System.Int32 _CustomerID;
        partial void OnCustomerIDChanging(global::System.Int32 value);
        partial void OnCustomerIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Name
        {
            get
            {
                return _Name;
            }
            set
            {
                OnNameChanging(value);
                ReportPropertyChanging("Name");
                _Name = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Name");
                OnNameChanged();
            }
        }
        private global::System.String _Name;
        partial void OnNameChanging(global::System.String value);
        partial void OnNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> SalesPersonID
        {
            get
            {
                return _SalesPersonID;
            }
            set
            {
                OnSalesPersonIDChanging(value);
                ReportPropertyChanging("SalesPersonID");
                _SalesPersonID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("SalesPersonID");
                OnSalesPersonIDChanged();
            }
        }
        private Nullable<global::System.Int32> _SalesPersonID;
        partial void OnSalesPersonIDChanging(Nullable<global::System.Int32> value);
        partial void OnSalesPersonIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String Demographics
        {
            get
            {
                return _Demographics;
            }
            set
            {
                OnDemographicsChanging(value);
                ReportPropertyChanging("Demographics");
                _Demographics = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("Demographics");
                OnDemographicsChanged();
            }
        }
        private global::System.String _Demographics;
        partial void OnDemographicsChanging(global::System.String value);
        partial void OnDemographicsChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Guid rowguid
        {
            get
            {
                return _rowguid;
            }
            set
            {
                OnrowguidChanging(value);
                ReportPropertyChanging("rowguid");
                _rowguid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("rowguid");
                OnrowguidChanged();
            }
        }
        private global::System.Guid _rowguid;
        partial void OnrowguidChanging(global::System.Guid value);
        partial void OnrowguidChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_Store_Customer_CustomerID", "Customer")]
        public Customer Customer
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Customer>("AdventureWorksModel.FK_Store_Customer_CustomerID", "Customer").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Customer>("AdventureWorksModel.FK_Store_Customer_CustomerID", "Customer").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Customer> CustomerReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Customer>("AdventureWorksModel.FK_Store_Customer_CustomerID", "Customer");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Customer>("AdventureWorksModel.FK_Store_Customer_CustomerID", "Customer", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_Store_SalesPerson_SalesPersonID", "SalesPerson")]
        public SalesPerson SalesPerson
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesPerson>("AdventureWorksModel.FK_Store_SalesPerson_SalesPersonID", "SalesPerson").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesPerson>("AdventureWorksModel.FK_Store_SalesPerson_SalesPersonID", "SalesPerson").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<SalesPerson> SalesPersonReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<SalesPerson>("AdventureWorksModel.FK_Store_SalesPerson_SalesPersonID", "SalesPerson");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<SalesPerson>("AdventureWorksModel.FK_Store_SalesPerson_SalesPersonID", "SalesPerson", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_StoreContact_Store_CustomerID", "StoreContact")]
        public EntityCollection<StoreContact> StoreContacts
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<StoreContact>("AdventureWorksModel.FK_StoreContact_Store_CustomerID", "StoreContact");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<StoreContact>("AdventureWorksModel.FK_StoreContact_Store_CustomerID", "StoreContact", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="StoreContact")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class StoreContact : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new StoreContact object.
        /// </summary>
        /// <param name="customerID">Initial value of the CustomerID property.</param>
        /// <param name="contactID">Initial value of the ContactID property.</param>
        /// <param name="contactTypeID">Initial value of the ContactTypeID property.</param>
        /// <param name="rowguid">Initial value of the rowguid property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static StoreContact CreateStoreContact(global::System.Int32 customerID, global::System.Int32 contactID, global::System.Int32 contactTypeID, global::System.Guid rowguid, global::System.DateTime modifiedDate)
        {
            StoreContact storeContact = new StoreContact();
            storeContact.CustomerID = customerID;
            storeContact.ContactID = contactID;
            storeContact.ContactTypeID = contactTypeID;
            storeContact.rowguid = rowguid;
            storeContact.ModifiedDate = modifiedDate;
            return storeContact;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 CustomerID
        {
            get
            {
                return _CustomerID;
            }
            set
            {
                if (_CustomerID != value)
                {
                    OnCustomerIDChanging(value);
                    ReportPropertyChanging("CustomerID");
                    _CustomerID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("CustomerID");
                    OnCustomerIDChanged();
                }
            }
        }
        private global::System.Int32 _CustomerID;
        partial void OnCustomerIDChanging(global::System.Int32 value);
        partial void OnCustomerIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ContactID
        {
            get
            {
                return _ContactID;
            }
            set
            {
                if (_ContactID != value)
                {
                    OnContactIDChanging(value);
                    ReportPropertyChanging("ContactID");
                    _ContactID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ContactID");
                    OnContactIDChanged();
                }
            }
        }
        private global::System.Int32 _ContactID;
        partial void OnContactIDChanging(global::System.Int32 value);
        partial void OnContactIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ContactTypeID
        {
            get
            {
                return _ContactTypeID;
            }
            set
            {
                OnContactTypeIDChanging(value);
                ReportPropertyChanging("ContactTypeID");
                _ContactTypeID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ContactTypeID");
                OnContactTypeIDChanged();
            }
        }
        private global::System.Int32 _ContactTypeID;
        partial void OnContactTypeIDChanging(global::System.Int32 value);
        partial void OnContactTypeIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Guid rowguid
        {
            get
            {
                return _rowguid;
            }
            set
            {
                OnrowguidChanging(value);
                ReportPropertyChanging("rowguid");
                _rowguid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("rowguid");
                OnrowguidChanged();
            }
        }
        private global::System.Guid _rowguid;
        partial void OnrowguidChanging(global::System.Guid value);
        partial void OnrowguidChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_StoreContact_Contact_ContactID", "Contact")]
        public Contact Contact
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Contact>("AdventureWorksModel.FK_StoreContact_Contact_ContactID", "Contact").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Contact>("AdventureWorksModel.FK_StoreContact_Contact_ContactID", "Contact").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Contact> ContactReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Contact>("AdventureWorksModel.FK_StoreContact_Contact_ContactID", "Contact");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Contact>("AdventureWorksModel.FK_StoreContact_Contact_ContactID", "Contact", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_StoreContact_ContactType_ContactTypeID", "ContactType")]
        public ContactType ContactType
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ContactType>("AdventureWorksModel.FK_StoreContact_ContactType_ContactTypeID", "ContactType").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ContactType>("AdventureWorksModel.FK_StoreContact_ContactType_ContactTypeID", "ContactType").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<ContactType> ContactTypeReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ContactType>("AdventureWorksModel.FK_StoreContact_ContactType_ContactTypeID", "ContactType");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<ContactType>("AdventureWorksModel.FK_StoreContact_ContactType_ContactTypeID", "ContactType", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_StoreContact_Store_CustomerID", "Store")]
        public Store Store
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Store>("AdventureWorksModel.FK_StoreContact_Store_CustomerID", "Store").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Store>("AdventureWorksModel.FK_StoreContact_Store_CustomerID", "Store").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Store> StoreReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Store>("AdventureWorksModel.FK_StoreContact_Store_CustomerID", "Store");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Store>("AdventureWorksModel.FK_StoreContact_Store_CustomerID", "Store", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="TransactionHistory")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class TransactionHistory : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new TransactionHistory object.
        /// </summary>
        /// <param name="transactionID">Initial value of the TransactionID property.</param>
        /// <param name="productID">Initial value of the ProductID property.</param>
        /// <param name="referenceOrderID">Initial value of the ReferenceOrderID property.</param>
        /// <param name="referenceOrderLineID">Initial value of the ReferenceOrderLineID property.</param>
        /// <param name="transactionDate">Initial value of the TransactionDate property.</param>
        /// <param name="transactionType">Initial value of the TransactionType property.</param>
        /// <param name="quantity">Initial value of the Quantity property.</param>
        /// <param name="actualCost">Initial value of the ActualCost property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static TransactionHistory CreateTransactionHistory(global::System.Int32 transactionID, global::System.Int32 productID, global::System.Int32 referenceOrderID, global::System.Int32 referenceOrderLineID, global::System.DateTime transactionDate, global::System.String transactionType, global::System.Int32 quantity, global::System.Decimal actualCost, global::System.DateTime modifiedDate)
        {
            TransactionHistory transactionHistory = new TransactionHistory();
            transactionHistory.TransactionID = transactionID;
            transactionHistory.ProductID = productID;
            transactionHistory.ReferenceOrderID = referenceOrderID;
            transactionHistory.ReferenceOrderLineID = referenceOrderLineID;
            transactionHistory.TransactionDate = transactionDate;
            transactionHistory.TransactionType = transactionType;
            transactionHistory.Quantity = quantity;
            transactionHistory.ActualCost = actualCost;
            transactionHistory.ModifiedDate = modifiedDate;
            return transactionHistory;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 TransactionID
        {
            get
            {
                return _TransactionID;
            }
            set
            {
                if (_TransactionID != value)
                {
                    OnTransactionIDChanging(value);
                    ReportPropertyChanging("TransactionID");
                    _TransactionID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("TransactionID");
                    OnTransactionIDChanged();
                }
            }
        }
        private global::System.Int32 _TransactionID;
        partial void OnTransactionIDChanging(global::System.Int32 value);
        partial void OnTransactionIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ProductID
        {
            get
            {
                return _ProductID;
            }
            set
            {
                OnProductIDChanging(value);
                ReportPropertyChanging("ProductID");
                _ProductID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ProductID");
                OnProductIDChanged();
            }
        }
        private global::System.Int32 _ProductID;
        partial void OnProductIDChanging(global::System.Int32 value);
        partial void OnProductIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ReferenceOrderID
        {
            get
            {
                return _ReferenceOrderID;
            }
            set
            {
                OnReferenceOrderIDChanging(value);
                ReportPropertyChanging("ReferenceOrderID");
                _ReferenceOrderID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ReferenceOrderID");
                OnReferenceOrderIDChanged();
            }
        }
        private global::System.Int32 _ReferenceOrderID;
        partial void OnReferenceOrderIDChanging(global::System.Int32 value);
        partial void OnReferenceOrderIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ReferenceOrderLineID
        {
            get
            {
                return _ReferenceOrderLineID;
            }
            set
            {
                OnReferenceOrderLineIDChanging(value);
                ReportPropertyChanging("ReferenceOrderLineID");
                _ReferenceOrderLineID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ReferenceOrderLineID");
                OnReferenceOrderLineIDChanged();
            }
        }
        private global::System.Int32 _ReferenceOrderLineID;
        partial void OnReferenceOrderLineIDChanging(global::System.Int32 value);
        partial void OnReferenceOrderLineIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime TransactionDate
        {
            get
            {
                return _TransactionDate;
            }
            set
            {
                OnTransactionDateChanging(value);
                ReportPropertyChanging("TransactionDate");
                _TransactionDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("TransactionDate");
                OnTransactionDateChanged();
            }
        }
        private global::System.DateTime _TransactionDate;
        partial void OnTransactionDateChanging(global::System.DateTime value);
        partial void OnTransactionDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String TransactionType
        {
            get
            {
                return _TransactionType;
            }
            set
            {
                OnTransactionTypeChanging(value);
                ReportPropertyChanging("TransactionType");
                _TransactionType = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("TransactionType");
                OnTransactionTypeChanged();
            }
        }
        private global::System.String _TransactionType;
        partial void OnTransactionTypeChanging(global::System.String value);
        partial void OnTransactionTypeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 Quantity
        {
            get
            {
                return _Quantity;
            }
            set
            {
                OnQuantityChanging(value);
                ReportPropertyChanging("Quantity");
                _Quantity = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("Quantity");
                OnQuantityChanged();
            }
        }
        private global::System.Int32 _Quantity;
        partial void OnQuantityChanging(global::System.Int32 value);
        partial void OnQuantityChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal ActualCost
        {
            get
            {
                return _ActualCost;
            }
            set
            {
                OnActualCostChanging(value);
                ReportPropertyChanging("ActualCost");
                _ActualCost = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ActualCost");
                OnActualCostChanged();
            }
        }
        private global::System.Decimal _ActualCost;
        partial void OnActualCostChanging(global::System.Decimal value);
        partial void OnActualCostChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_TransactionHistory_Product_ProductID", "Product")]
        public Product Product
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_TransactionHistory_Product_ProductID", "Product").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_TransactionHistory_Product_ProductID", "Product").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Product> ProductReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_TransactionHistory_Product_ProductID", "Product");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Product>("AdventureWorksModel.FK_TransactionHistory_Product_ProductID", "Product", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="TransactionHistoryArchive")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class TransactionHistoryArchive : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new TransactionHistoryArchive object.
        /// </summary>
        /// <param name="transactionID">Initial value of the TransactionID property.</param>
        /// <param name="productID">Initial value of the ProductID property.</param>
        /// <param name="referenceOrderID">Initial value of the ReferenceOrderID property.</param>
        /// <param name="referenceOrderLineID">Initial value of the ReferenceOrderLineID property.</param>
        /// <param name="transactionDate">Initial value of the TransactionDate property.</param>
        /// <param name="transactionType">Initial value of the TransactionType property.</param>
        /// <param name="quantity">Initial value of the Quantity property.</param>
        /// <param name="actualCost">Initial value of the ActualCost property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static TransactionHistoryArchive CreateTransactionHistoryArchive(global::System.Int32 transactionID, global::System.Int32 productID, global::System.Int32 referenceOrderID, global::System.Int32 referenceOrderLineID, global::System.DateTime transactionDate, global::System.String transactionType, global::System.Int32 quantity, global::System.Decimal actualCost, global::System.DateTime modifiedDate)
        {
            TransactionHistoryArchive transactionHistoryArchive = new TransactionHistoryArchive();
            transactionHistoryArchive.TransactionID = transactionID;
            transactionHistoryArchive.ProductID = productID;
            transactionHistoryArchive.ReferenceOrderID = referenceOrderID;
            transactionHistoryArchive.ReferenceOrderLineID = referenceOrderLineID;
            transactionHistoryArchive.TransactionDate = transactionDate;
            transactionHistoryArchive.TransactionType = transactionType;
            transactionHistoryArchive.Quantity = quantity;
            transactionHistoryArchive.ActualCost = actualCost;
            transactionHistoryArchive.ModifiedDate = modifiedDate;
            return transactionHistoryArchive;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 TransactionID
        {
            get
            {
                return _TransactionID;
            }
            set
            {
                if (_TransactionID != value)
                {
                    OnTransactionIDChanging(value);
                    ReportPropertyChanging("TransactionID");
                    _TransactionID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("TransactionID");
                    OnTransactionIDChanged();
                }
            }
        }
        private global::System.Int32 _TransactionID;
        partial void OnTransactionIDChanging(global::System.Int32 value);
        partial void OnTransactionIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ProductID
        {
            get
            {
                return _ProductID;
            }
            set
            {
                OnProductIDChanging(value);
                ReportPropertyChanging("ProductID");
                _ProductID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ProductID");
                OnProductIDChanged();
            }
        }
        private global::System.Int32 _ProductID;
        partial void OnProductIDChanging(global::System.Int32 value);
        partial void OnProductIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ReferenceOrderID
        {
            get
            {
                return _ReferenceOrderID;
            }
            set
            {
                OnReferenceOrderIDChanging(value);
                ReportPropertyChanging("ReferenceOrderID");
                _ReferenceOrderID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ReferenceOrderID");
                OnReferenceOrderIDChanged();
            }
        }
        private global::System.Int32 _ReferenceOrderID;
        partial void OnReferenceOrderIDChanging(global::System.Int32 value);
        partial void OnReferenceOrderIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ReferenceOrderLineID
        {
            get
            {
                return _ReferenceOrderLineID;
            }
            set
            {
                OnReferenceOrderLineIDChanging(value);
                ReportPropertyChanging("ReferenceOrderLineID");
                _ReferenceOrderLineID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ReferenceOrderLineID");
                OnReferenceOrderLineIDChanged();
            }
        }
        private global::System.Int32 _ReferenceOrderLineID;
        partial void OnReferenceOrderLineIDChanging(global::System.Int32 value);
        partial void OnReferenceOrderLineIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime TransactionDate
        {
            get
            {
                return _TransactionDate;
            }
            set
            {
                OnTransactionDateChanging(value);
                ReportPropertyChanging("TransactionDate");
                _TransactionDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("TransactionDate");
                OnTransactionDateChanged();
            }
        }
        private global::System.DateTime _TransactionDate;
        partial void OnTransactionDateChanging(global::System.DateTime value);
        partial void OnTransactionDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String TransactionType
        {
            get
            {
                return _TransactionType;
            }
            set
            {
                OnTransactionTypeChanging(value);
                ReportPropertyChanging("TransactionType");
                _TransactionType = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("TransactionType");
                OnTransactionTypeChanged();
            }
        }
        private global::System.String _TransactionType;
        partial void OnTransactionTypeChanging(global::System.String value);
        partial void OnTransactionTypeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 Quantity
        {
            get
            {
                return _Quantity;
            }
            set
            {
                OnQuantityChanging(value);
                ReportPropertyChanging("Quantity");
                _Quantity = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("Quantity");
                OnQuantityChanged();
            }
        }
        private global::System.Int32 _Quantity;
        partial void OnQuantityChanging(global::System.Int32 value);
        partial void OnQuantityChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal ActualCost
        {
            get
            {
                return _ActualCost;
            }
            set
            {
                OnActualCostChanging(value);
                ReportPropertyChanging("ActualCost");
                _ActualCost = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ActualCost");
                OnActualCostChanged();
            }
        }
        private global::System.Decimal _ActualCost;
        partial void OnActualCostChanging(global::System.Decimal value);
        partial void OnActualCostChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="UnitMeasure")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class UnitMeasure : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new UnitMeasure object.
        /// </summary>
        /// <param name="unitMeasureCode">Initial value of the UnitMeasureCode property.</param>
        /// <param name="name">Initial value of the Name property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static UnitMeasure CreateUnitMeasure(global::System.String unitMeasureCode, global::System.String name, global::System.DateTime modifiedDate)
        {
            UnitMeasure unitMeasure = new UnitMeasure();
            unitMeasure.UnitMeasureCode = unitMeasureCode;
            unitMeasure.Name = name;
            unitMeasure.ModifiedDate = modifiedDate;
            return unitMeasure;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String UnitMeasureCode
        {
            get
            {
                return _UnitMeasureCode;
            }
            set
            {
                if (_UnitMeasureCode != value)
                {
                    OnUnitMeasureCodeChanging(value);
                    ReportPropertyChanging("UnitMeasureCode");
                    _UnitMeasureCode = StructuralObject.SetValidValue(value, false);
                    ReportPropertyChanged("UnitMeasureCode");
                    OnUnitMeasureCodeChanged();
                }
            }
        }
        private global::System.String _UnitMeasureCode;
        partial void OnUnitMeasureCodeChanging(global::System.String value);
        partial void OnUnitMeasureCodeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Name
        {
            get
            {
                return _Name;
            }
            set
            {
                OnNameChanging(value);
                ReportPropertyChanging("Name");
                _Name = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Name");
                OnNameChanged();
            }
        }
        private global::System.String _Name;
        partial void OnNameChanging(global::System.String value);
        partial void OnNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_BillOfMaterials_UnitMeasure_UnitMeasureCode", "BillOfMaterials")]
        public EntityCollection<BillOfMaterial> BillOfMaterials
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<BillOfMaterial>("AdventureWorksModel.FK_BillOfMaterials_UnitMeasure_UnitMeasureCode", "BillOfMaterials");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<BillOfMaterial>("AdventureWorksModel.FK_BillOfMaterials_UnitMeasure_UnitMeasureCode", "BillOfMaterials", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_Product_UnitMeasure_SizeUnitMeasureCode", "Product")]
        public EntityCollection<Product> Products
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<Product>("AdventureWorksModel.FK_Product_UnitMeasure_SizeUnitMeasureCode", "Product");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<Product>("AdventureWorksModel.FK_Product_UnitMeasure_SizeUnitMeasureCode", "Product", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_Product_UnitMeasure_WeightUnitMeasureCode", "Product")]
        public EntityCollection<Product> Products1
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<Product>("AdventureWorksModel.FK_Product_UnitMeasure_WeightUnitMeasureCode", "Product");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<Product>("AdventureWorksModel.FK_Product_UnitMeasure_WeightUnitMeasureCode", "Product", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductVendor_UnitMeasure_UnitMeasureCode", "ProductVendor")]
        public EntityCollection<ProductVendor> ProductVendors
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<ProductVendor>("AdventureWorksModel.FK_ProductVendor_UnitMeasure_UnitMeasureCode", "ProductVendor");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<ProductVendor>("AdventureWorksModel.FK_ProductVendor_UnitMeasure_UnitMeasureCode", "ProductVendor", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="Vendor")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class Vendor : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new Vendor object.
        /// </summary>
        /// <param name="vendorID">Initial value of the VendorID property.</param>
        /// <param name="accountNumber">Initial value of the AccountNumber property.</param>
        /// <param name="name">Initial value of the Name property.</param>
        /// <param name="creditRating">Initial value of the CreditRating property.</param>
        /// <param name="preferredVendorStatus">Initial value of the PreferredVendorStatus property.</param>
        /// <param name="activeFlag">Initial value of the ActiveFlag property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static Vendor CreateVendor(global::System.Int32 vendorID, global::System.String accountNumber, global::System.String name, global::System.Byte creditRating, global::System.Boolean preferredVendorStatus, global::System.Boolean activeFlag, global::System.DateTime modifiedDate)
        {
            Vendor vendor = new Vendor();
            vendor.VendorID = vendorID;
            vendor.AccountNumber = accountNumber;
            vendor.Name = name;
            vendor.CreditRating = creditRating;
            vendor.PreferredVendorStatus = preferredVendorStatus;
            vendor.ActiveFlag = activeFlag;
            vendor.ModifiedDate = modifiedDate;
            return vendor;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 VendorID
        {
            get
            {
                return _VendorID;
            }
            set
            {
                if (_VendorID != value)
                {
                    OnVendorIDChanging(value);
                    ReportPropertyChanging("VendorID");
                    _VendorID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("VendorID");
                    OnVendorIDChanged();
                }
            }
        }
        private global::System.Int32 _VendorID;
        partial void OnVendorIDChanging(global::System.Int32 value);
        partial void OnVendorIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String AccountNumber
        {
            get
            {
                return _AccountNumber;
            }
            set
            {
                OnAccountNumberChanging(value);
                ReportPropertyChanging("AccountNumber");
                _AccountNumber = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("AccountNumber");
                OnAccountNumberChanged();
            }
        }
        private global::System.String _AccountNumber;
        partial void OnAccountNumberChanging(global::System.String value);
        partial void OnAccountNumberChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Name
        {
            get
            {
                return _Name;
            }
            set
            {
                OnNameChanging(value);
                ReportPropertyChanging("Name");
                _Name = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Name");
                OnNameChanged();
            }
        }
        private global::System.String _Name;
        partial void OnNameChanging(global::System.String value);
        partial void OnNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Byte CreditRating
        {
            get
            {
                return _CreditRating;
            }
            set
            {
                OnCreditRatingChanging(value);
                ReportPropertyChanging("CreditRating");
                _CreditRating = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("CreditRating");
                OnCreditRatingChanged();
            }
        }
        private global::System.Byte _CreditRating;
        partial void OnCreditRatingChanging(global::System.Byte value);
        partial void OnCreditRatingChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Boolean PreferredVendorStatus
        {
            get
            {
                return _PreferredVendorStatus;
            }
            set
            {
                OnPreferredVendorStatusChanging(value);
                ReportPropertyChanging("PreferredVendorStatus");
                _PreferredVendorStatus = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("PreferredVendorStatus");
                OnPreferredVendorStatusChanged();
            }
        }
        private global::System.Boolean _PreferredVendorStatus;
        partial void OnPreferredVendorStatusChanging(global::System.Boolean value);
        partial void OnPreferredVendorStatusChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Boolean ActiveFlag
        {
            get
            {
                return _ActiveFlag;
            }
            set
            {
                OnActiveFlagChanging(value);
                ReportPropertyChanging("ActiveFlag");
                _ActiveFlag = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ActiveFlag");
                OnActiveFlagChanged();
            }
        }
        private global::System.Boolean _ActiveFlag;
        partial void OnActiveFlagChanging(global::System.Boolean value);
        partial void OnActiveFlagChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String PurchasingWebServiceURL
        {
            get
            {
                return _PurchasingWebServiceURL;
            }
            set
            {
                OnPurchasingWebServiceURLChanging(value);
                ReportPropertyChanging("PurchasingWebServiceURL");
                _PurchasingWebServiceURL = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("PurchasingWebServiceURL");
                OnPurchasingWebServiceURLChanged();
            }
        }
        private global::System.String _PurchasingWebServiceURL;
        partial void OnPurchasingWebServiceURLChanging(global::System.String value);
        partial void OnPurchasingWebServiceURLChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductVendor_Vendor_VendorID", "ProductVendor")]
        public EntityCollection<ProductVendor> ProductVendors
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<ProductVendor>("AdventureWorksModel.FK_ProductVendor_Vendor_VendorID", "ProductVendor");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<ProductVendor>("AdventureWorksModel.FK_ProductVendor_Vendor_VendorID", "ProductVendor", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_PurchaseOrderHeader_Vendor_VendorID", "PurchaseOrderHeader")]
        public EntityCollection<PurchaseOrderHeader> PurchaseOrderHeaders
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<PurchaseOrderHeader>("AdventureWorksModel.FK_PurchaseOrderHeader_Vendor_VendorID", "PurchaseOrderHeader");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<PurchaseOrderHeader>("AdventureWorksModel.FK_PurchaseOrderHeader_Vendor_VendorID", "PurchaseOrderHeader", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_VendorAddress_Vendor_VendorID", "VendorAddress")]
        public EntityCollection<VendorAddress> VendorAddresses
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<VendorAddress>("AdventureWorksModel.FK_VendorAddress_Vendor_VendorID", "VendorAddress");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<VendorAddress>("AdventureWorksModel.FK_VendorAddress_Vendor_VendorID", "VendorAddress", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_VendorContact_Vendor_VendorID", "VendorContact")]
        public EntityCollection<VendorContact> VendorContacts
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<VendorContact>("AdventureWorksModel.FK_VendorContact_Vendor_VendorID", "VendorContact");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<VendorContact>("AdventureWorksModel.FK_VendorContact_Vendor_VendorID", "VendorContact", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="VendorAddress")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class VendorAddress : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new VendorAddress object.
        /// </summary>
        /// <param name="vendorID">Initial value of the VendorID property.</param>
        /// <param name="addressID">Initial value of the AddressID property.</param>
        /// <param name="addressTypeID">Initial value of the AddressTypeID property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static VendorAddress CreateVendorAddress(global::System.Int32 vendorID, global::System.Int32 addressID, global::System.Int32 addressTypeID, global::System.DateTime modifiedDate)
        {
            VendorAddress vendorAddress = new VendorAddress();
            vendorAddress.VendorID = vendorID;
            vendorAddress.AddressID = addressID;
            vendorAddress.AddressTypeID = addressTypeID;
            vendorAddress.ModifiedDate = modifiedDate;
            return vendorAddress;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 VendorID
        {
            get
            {
                return _VendorID;
            }
            set
            {
                if (_VendorID != value)
                {
                    OnVendorIDChanging(value);
                    ReportPropertyChanging("VendorID");
                    _VendorID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("VendorID");
                    OnVendorIDChanged();
                }
            }
        }
        private global::System.Int32 _VendorID;
        partial void OnVendorIDChanging(global::System.Int32 value);
        partial void OnVendorIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 AddressID
        {
            get
            {
                return _AddressID;
            }
            set
            {
                if (_AddressID != value)
                {
                    OnAddressIDChanging(value);
                    ReportPropertyChanging("AddressID");
                    _AddressID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("AddressID");
                    OnAddressIDChanged();
                }
            }
        }
        private global::System.Int32 _AddressID;
        partial void OnAddressIDChanging(global::System.Int32 value);
        partial void OnAddressIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 AddressTypeID
        {
            get
            {
                return _AddressTypeID;
            }
            set
            {
                OnAddressTypeIDChanging(value);
                ReportPropertyChanging("AddressTypeID");
                _AddressTypeID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("AddressTypeID");
                OnAddressTypeIDChanged();
            }
        }
        private global::System.Int32 _AddressTypeID;
        partial void OnAddressTypeIDChanging(global::System.Int32 value);
        partial void OnAddressTypeIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_VendorAddress_Address_AddressID", "Address")]
        public Address Address
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Address>("AdventureWorksModel.FK_VendorAddress_Address_AddressID", "Address").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Address>("AdventureWorksModel.FK_VendorAddress_Address_AddressID", "Address").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Address> AddressReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Address>("AdventureWorksModel.FK_VendorAddress_Address_AddressID", "Address");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Address>("AdventureWorksModel.FK_VendorAddress_Address_AddressID", "Address", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_VendorAddress_AddressType_AddressTypeID", "AddressType")]
        public AddressType AddressType
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<AddressType>("AdventureWorksModel.FK_VendorAddress_AddressType_AddressTypeID", "AddressType").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<AddressType>("AdventureWorksModel.FK_VendorAddress_AddressType_AddressTypeID", "AddressType").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<AddressType> AddressTypeReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<AddressType>("AdventureWorksModel.FK_VendorAddress_AddressType_AddressTypeID", "AddressType");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<AddressType>("AdventureWorksModel.FK_VendorAddress_AddressType_AddressTypeID", "AddressType", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_VendorAddress_Vendor_VendorID", "Vendor")]
        public Vendor Vendor
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Vendor>("AdventureWorksModel.FK_VendorAddress_Vendor_VendorID", "Vendor").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Vendor>("AdventureWorksModel.FK_VendorAddress_Vendor_VendorID", "Vendor").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Vendor> VendorReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Vendor>("AdventureWorksModel.FK_VendorAddress_Vendor_VendorID", "Vendor");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Vendor>("AdventureWorksModel.FK_VendorAddress_Vendor_VendorID", "Vendor", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="VendorContact")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class VendorContact : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new VendorContact object.
        /// </summary>
        /// <param name="vendorID">Initial value of the VendorID property.</param>
        /// <param name="contactID">Initial value of the ContactID property.</param>
        /// <param name="contactTypeID">Initial value of the ContactTypeID property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static VendorContact CreateVendorContact(global::System.Int32 vendorID, global::System.Int32 contactID, global::System.Int32 contactTypeID, global::System.DateTime modifiedDate)
        {
            VendorContact vendorContact = new VendorContact();
            vendorContact.VendorID = vendorID;
            vendorContact.ContactID = contactID;
            vendorContact.ContactTypeID = contactTypeID;
            vendorContact.ModifiedDate = modifiedDate;
            return vendorContact;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 VendorID
        {
            get
            {
                return _VendorID;
            }
            set
            {
                if (_VendorID != value)
                {
                    OnVendorIDChanging(value);
                    ReportPropertyChanging("VendorID");
                    _VendorID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("VendorID");
                    OnVendorIDChanged();
                }
            }
        }
        private global::System.Int32 _VendorID;
        partial void OnVendorIDChanging(global::System.Int32 value);
        partial void OnVendorIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ContactID
        {
            get
            {
                return _ContactID;
            }
            set
            {
                if (_ContactID != value)
                {
                    OnContactIDChanging(value);
                    ReportPropertyChanging("ContactID");
                    _ContactID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ContactID");
                    OnContactIDChanged();
                }
            }
        }
        private global::System.Int32 _ContactID;
        partial void OnContactIDChanging(global::System.Int32 value);
        partial void OnContactIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ContactTypeID
        {
            get
            {
                return _ContactTypeID;
            }
            set
            {
                OnContactTypeIDChanging(value);
                ReportPropertyChanging("ContactTypeID");
                _ContactTypeID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ContactTypeID");
                OnContactTypeIDChanged();
            }
        }
        private global::System.Int32 _ContactTypeID;
        partial void OnContactTypeIDChanging(global::System.Int32 value);
        partial void OnContactTypeIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_VendorContact_Contact_ContactID", "Contact")]
        public Contact Contact
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Contact>("AdventureWorksModel.FK_VendorContact_Contact_ContactID", "Contact").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Contact>("AdventureWorksModel.FK_VendorContact_Contact_ContactID", "Contact").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Contact> ContactReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Contact>("AdventureWorksModel.FK_VendorContact_Contact_ContactID", "Contact");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Contact>("AdventureWorksModel.FK_VendorContact_Contact_ContactID", "Contact", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_VendorContact_ContactType_ContactTypeID", "ContactType")]
        public ContactType ContactType
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ContactType>("AdventureWorksModel.FK_VendorContact_ContactType_ContactTypeID", "ContactType").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ContactType>("AdventureWorksModel.FK_VendorContact_ContactType_ContactTypeID", "ContactType").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<ContactType> ContactTypeReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ContactType>("AdventureWorksModel.FK_VendorContact_ContactType_ContactTypeID", "ContactType");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<ContactType>("AdventureWorksModel.FK_VendorContact_ContactType_ContactTypeID", "ContactType", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_VendorContact_Vendor_VendorID", "Vendor")]
        public Vendor Vendor
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Vendor>("AdventureWorksModel.FK_VendorContact_Vendor_VendorID", "Vendor").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Vendor>("AdventureWorksModel.FK_VendorContact_Vendor_VendorID", "Vendor").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Vendor> VendorReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Vendor>("AdventureWorksModel.FK_VendorContact_Vendor_VendorID", "Vendor");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Vendor>("AdventureWorksModel.FK_VendorContact_Vendor_VendorID", "Vendor", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="WorkOrder")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class WorkOrder : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new WorkOrder object.
        /// </summary>
        /// <param name="workOrderID">Initial value of the WorkOrderID property.</param>
        /// <param name="productID">Initial value of the ProductID property.</param>
        /// <param name="orderQty">Initial value of the OrderQty property.</param>
        /// <param name="stockedQty">Initial value of the StockedQty property.</param>
        /// <param name="scrappedQty">Initial value of the ScrappedQty property.</param>
        /// <param name="startDate">Initial value of the StartDate property.</param>
        /// <param name="dueDate">Initial value of the DueDate property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static WorkOrder CreateWorkOrder(global::System.Int32 workOrderID, global::System.Int32 productID, global::System.Int32 orderQty, global::System.Int32 stockedQty, global::System.Int16 scrappedQty, global::System.DateTime startDate, global::System.DateTime dueDate, global::System.DateTime modifiedDate)
        {
            WorkOrder workOrder = new WorkOrder();
            workOrder.WorkOrderID = workOrderID;
            workOrder.ProductID = productID;
            workOrder.OrderQty = orderQty;
            workOrder.StockedQty = stockedQty;
            workOrder.ScrappedQty = scrappedQty;
            workOrder.StartDate = startDate;
            workOrder.DueDate = dueDate;
            workOrder.ModifiedDate = modifiedDate;
            return workOrder;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 WorkOrderID
        {
            get
            {
                return _WorkOrderID;
            }
            set
            {
                if (_WorkOrderID != value)
                {
                    OnWorkOrderIDChanging(value);
                    ReportPropertyChanging("WorkOrderID");
                    _WorkOrderID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("WorkOrderID");
                    OnWorkOrderIDChanged();
                }
            }
        }
        private global::System.Int32 _WorkOrderID;
        partial void OnWorkOrderIDChanging(global::System.Int32 value);
        partial void OnWorkOrderIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ProductID
        {
            get
            {
                return _ProductID;
            }
            set
            {
                OnProductIDChanging(value);
                ReportPropertyChanging("ProductID");
                _ProductID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ProductID");
                OnProductIDChanged();
            }
        }
        private global::System.Int32 _ProductID;
        partial void OnProductIDChanging(global::System.Int32 value);
        partial void OnProductIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 OrderQty
        {
            get
            {
                return _OrderQty;
            }
            set
            {
                OnOrderQtyChanging(value);
                ReportPropertyChanging("OrderQty");
                _OrderQty = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("OrderQty");
                OnOrderQtyChanged();
            }
        }
        private global::System.Int32 _OrderQty;
        partial void OnOrderQtyChanging(global::System.Int32 value);
        partial void OnOrderQtyChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 StockedQty
        {
            get
            {
                return _StockedQty;
            }
            set
            {
                OnStockedQtyChanging(value);
                ReportPropertyChanging("StockedQty");
                _StockedQty = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("StockedQty");
                OnStockedQtyChanged();
            }
        }
        private global::System.Int32 _StockedQty;
        partial void OnStockedQtyChanging(global::System.Int32 value);
        partial void OnStockedQtyChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int16 ScrappedQty
        {
            get
            {
                return _ScrappedQty;
            }
            set
            {
                OnScrappedQtyChanging(value);
                ReportPropertyChanging("ScrappedQty");
                _ScrappedQty = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ScrappedQty");
                OnScrappedQtyChanged();
            }
        }
        private global::System.Int16 _ScrappedQty;
        partial void OnScrappedQtyChanging(global::System.Int16 value);
        partial void OnScrappedQtyChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime StartDate
        {
            get
            {
                return _StartDate;
            }
            set
            {
                OnStartDateChanging(value);
                ReportPropertyChanging("StartDate");
                _StartDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("StartDate");
                OnStartDateChanged();
            }
        }
        private global::System.DateTime _StartDate;
        partial void OnStartDateChanging(global::System.DateTime value);
        partial void OnStartDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.DateTime> EndDate
        {
            get
            {
                return _EndDate;
            }
            set
            {
                OnEndDateChanging(value);
                ReportPropertyChanging("EndDate");
                _EndDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("EndDate");
                OnEndDateChanged();
            }
        }
        private Nullable<global::System.DateTime> _EndDate;
        partial void OnEndDateChanging(Nullable<global::System.DateTime> value);
        partial void OnEndDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime DueDate
        {
            get
            {
                return _DueDate;
            }
            set
            {
                OnDueDateChanging(value);
                ReportPropertyChanging("DueDate");
                _DueDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("DueDate");
                OnDueDateChanged();
            }
        }
        private global::System.DateTime _DueDate;
        partial void OnDueDateChanging(global::System.DateTime value);
        partial void OnDueDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int16> ScrapReasonID
        {
            get
            {
                return _ScrapReasonID;
            }
            set
            {
                OnScrapReasonIDChanging(value);
                ReportPropertyChanging("ScrapReasonID");
                _ScrapReasonID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ScrapReasonID");
                OnScrapReasonIDChanged();
            }
        }
        private Nullable<global::System.Int16> _ScrapReasonID;
        partial void OnScrapReasonIDChanging(Nullable<global::System.Int16> value);
        partial void OnScrapReasonIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_WorkOrder_Product_ProductID", "Product")]
        public Product Product
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_WorkOrder_Product_ProductID", "Product").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_WorkOrder_Product_ProductID", "Product").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Product> ProductReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_WorkOrder_Product_ProductID", "Product");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Product>("AdventureWorksModel.FK_WorkOrder_Product_ProductID", "Product", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_WorkOrder_ScrapReason_ScrapReasonID", "ScrapReason")]
        public ScrapReason ScrapReason
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ScrapReason>("AdventureWorksModel.FK_WorkOrder_ScrapReason_ScrapReasonID", "ScrapReason").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ScrapReason>("AdventureWorksModel.FK_WorkOrder_ScrapReason_ScrapReasonID", "ScrapReason").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<ScrapReason> ScrapReasonReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ScrapReason>("AdventureWorksModel.FK_WorkOrder_ScrapReason_ScrapReasonID", "ScrapReason");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<ScrapReason>("AdventureWorksModel.FK_WorkOrder_ScrapReason_ScrapReasonID", "ScrapReason", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_WorkOrderRouting_WorkOrder_WorkOrderID", "WorkOrderRouting")]
        public EntityCollection<WorkOrderRouting> WorkOrderRoutings
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<WorkOrderRouting>("AdventureWorksModel.FK_WorkOrderRouting_WorkOrder_WorkOrderID", "WorkOrderRouting");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<WorkOrderRouting>("AdventureWorksModel.FK_WorkOrderRouting_WorkOrder_WorkOrderID", "WorkOrderRouting", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="AdventureWorksModel", Name="WorkOrderRouting")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class WorkOrderRouting : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new WorkOrderRouting object.
        /// </summary>
        /// <param name="workOrderID">Initial value of the WorkOrderID property.</param>
        /// <param name="productID">Initial value of the ProductID property.</param>
        /// <param name="operationSequence">Initial value of the OperationSequence property.</param>
        /// <param name="locationID">Initial value of the LocationID property.</param>
        /// <param name="scheduledStartDate">Initial value of the ScheduledStartDate property.</param>
        /// <param name="scheduledEndDate">Initial value of the ScheduledEndDate property.</param>
        /// <param name="plannedCost">Initial value of the PlannedCost property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        public static WorkOrderRouting CreateWorkOrderRouting(global::System.Int32 workOrderID, global::System.Int32 productID, global::System.Int16 operationSequence, global::System.Int16 locationID, global::System.DateTime scheduledStartDate, global::System.DateTime scheduledEndDate, global::System.Decimal plannedCost, global::System.DateTime modifiedDate)
        {
            WorkOrderRouting workOrderRouting = new WorkOrderRouting();
            workOrderRouting.WorkOrderID = workOrderID;
            workOrderRouting.ProductID = productID;
            workOrderRouting.OperationSequence = operationSequence;
            workOrderRouting.LocationID = locationID;
            workOrderRouting.ScheduledStartDate = scheduledStartDate;
            workOrderRouting.ScheduledEndDate = scheduledEndDate;
            workOrderRouting.PlannedCost = plannedCost;
            workOrderRouting.ModifiedDate = modifiedDate;
            return workOrderRouting;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 WorkOrderID
        {
            get
            {
                return _WorkOrderID;
            }
            set
            {
                if (_WorkOrderID != value)
                {
                    OnWorkOrderIDChanging(value);
                    ReportPropertyChanging("WorkOrderID");
                    _WorkOrderID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("WorkOrderID");
                    OnWorkOrderIDChanged();
                }
            }
        }
        private global::System.Int32 _WorkOrderID;
        partial void OnWorkOrderIDChanging(global::System.Int32 value);
        partial void OnWorkOrderIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ProductID
        {
            get
            {
                return _ProductID;
            }
            set
            {
                if (_ProductID != value)
                {
                    OnProductIDChanging(value);
                    ReportPropertyChanging("ProductID");
                    _ProductID = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ProductID");
                    OnProductIDChanged();
                }
            }
        }
        private global::System.Int32 _ProductID;
        partial void OnProductIDChanging(global::System.Int32 value);
        partial void OnProductIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int16 OperationSequence
        {
            get
            {
                return _OperationSequence;
            }
            set
            {
                if (_OperationSequence != value)
                {
                    OnOperationSequenceChanging(value);
                    ReportPropertyChanging("OperationSequence");
                    _OperationSequence = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("OperationSequence");
                    OnOperationSequenceChanged();
                }
            }
        }
        private global::System.Int16 _OperationSequence;
        partial void OnOperationSequenceChanging(global::System.Int16 value);
        partial void OnOperationSequenceChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int16 LocationID
        {
            get
            {
                return _LocationID;
            }
            set
            {
                OnLocationIDChanging(value);
                ReportPropertyChanging("LocationID");
                _LocationID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("LocationID");
                OnLocationIDChanged();
            }
        }
        private global::System.Int16 _LocationID;
        partial void OnLocationIDChanging(global::System.Int16 value);
        partial void OnLocationIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ScheduledStartDate
        {
            get
            {
                return _ScheduledStartDate;
            }
            set
            {
                OnScheduledStartDateChanging(value);
                ReportPropertyChanging("ScheduledStartDate");
                _ScheduledStartDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ScheduledStartDate");
                OnScheduledStartDateChanged();
            }
        }
        private global::System.DateTime _ScheduledStartDate;
        partial void OnScheduledStartDateChanging(global::System.DateTime value);
        partial void OnScheduledStartDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ScheduledEndDate
        {
            get
            {
                return _ScheduledEndDate;
            }
            set
            {
                OnScheduledEndDateChanging(value);
                ReportPropertyChanging("ScheduledEndDate");
                _ScheduledEndDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ScheduledEndDate");
                OnScheduledEndDateChanged();
            }
        }
        private global::System.DateTime _ScheduledEndDate;
        partial void OnScheduledEndDateChanging(global::System.DateTime value);
        partial void OnScheduledEndDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.DateTime> ActualStartDate
        {
            get
            {
                return _ActualStartDate;
            }
            set
            {
                OnActualStartDateChanging(value);
                ReportPropertyChanging("ActualStartDate");
                _ActualStartDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ActualStartDate");
                OnActualStartDateChanged();
            }
        }
        private Nullable<global::System.DateTime> _ActualStartDate;
        partial void OnActualStartDateChanging(Nullable<global::System.DateTime> value);
        partial void OnActualStartDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.DateTime> ActualEndDate
        {
            get
            {
                return _ActualEndDate;
            }
            set
            {
                OnActualEndDateChanging(value);
                ReportPropertyChanging("ActualEndDate");
                _ActualEndDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ActualEndDate");
                OnActualEndDateChanged();
            }
        }
        private Nullable<global::System.DateTime> _ActualEndDate;
        partial void OnActualEndDateChanging(Nullable<global::System.DateTime> value);
        partial void OnActualEndDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Decimal> ActualResourceHrs
        {
            get
            {
                return _ActualResourceHrs;
            }
            set
            {
                OnActualResourceHrsChanging(value);
                ReportPropertyChanging("ActualResourceHrs");
                _ActualResourceHrs = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ActualResourceHrs");
                OnActualResourceHrsChanged();
            }
        }
        private Nullable<global::System.Decimal> _ActualResourceHrs;
        partial void OnActualResourceHrsChanging(Nullable<global::System.Decimal> value);
        partial void OnActualResourceHrsChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal PlannedCost
        {
            get
            {
                return _PlannedCost;
            }
            set
            {
                OnPlannedCostChanging(value);
                ReportPropertyChanging("PlannedCost");
                _PlannedCost = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("PlannedCost");
                OnPlannedCostChanged();
            }
        }
        private global::System.Decimal _PlannedCost;
        partial void OnPlannedCostChanging(global::System.Decimal value);
        partial void OnPlannedCostChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Decimal> ActualCost
        {
            get
            {
                return _ActualCost;
            }
            set
            {
                OnActualCostChanging(value);
                ReportPropertyChanging("ActualCost");
                _ActualCost = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ActualCost");
                OnActualCostChanged();
            }
        }
        private Nullable<global::System.Decimal> _ActualCost;
        partial void OnActualCostChanging(Nullable<global::System.Decimal> value);
        partial void OnActualCostChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_WorkOrderRouting_Location_LocationID", "Location")]
        public Location Location
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Location>("AdventureWorksModel.FK_WorkOrderRouting_Location_LocationID", "Location").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Location>("AdventureWorksModel.FK_WorkOrderRouting_Location_LocationID", "Location").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Location> LocationReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Location>("AdventureWorksModel.FK_WorkOrderRouting_Location_LocationID", "Location");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Location>("AdventureWorksModel.FK_WorkOrderRouting_Location_LocationID", "Location", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_WorkOrderRouting_WorkOrder_WorkOrderID", "WorkOrder")]
        public WorkOrder WorkOrder
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<WorkOrder>("AdventureWorksModel.FK_WorkOrderRouting_WorkOrder_WorkOrderID", "WorkOrder").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<WorkOrder>("AdventureWorksModel.FK_WorkOrderRouting_WorkOrder_WorkOrderID", "WorkOrder").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<WorkOrder> WorkOrderReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<WorkOrder>("AdventureWorksModel.FK_WorkOrderRouting_WorkOrder_WorkOrderID", "WorkOrder");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<WorkOrder>("AdventureWorksModel.FK_WorkOrderRouting_WorkOrder_WorkOrderID", "WorkOrder", value);
                }
            }
        }

        #endregion
    }

    #endregion
    #region ComplexTypes
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmComplexTypeAttribute(NamespaceName="AdventureWorksModel", Name="GetOrders_Result")]
    [DataContractAttribute(IsReference=true)]
    [Serializable()]
    public partial class GetOrders_Result : ComplexObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new GetOrders_Result object.
        /// </summary>
        /// <param name="salesOrderID">Initial value of the SalesOrderID property.</param>
        /// <param name="revisionNumber">Initial value of the RevisionNumber property.</param>
        /// <param name="orderDate">Initial value of the OrderDate property.</param>
        /// <param name="dueDate">Initial value of the DueDate property.</param>
        /// <param name="status">Initial value of the Status property.</param>
        /// <param name="onlineOrderFlag">Initial value of the OnlineOrderFlag property.</param>
        /// <param name="salesOrderNumber">Initial value of the SalesOrderNumber property.</param>
        /// <param name="customerID">Initial value of the CustomerID property.</param>
        /// <param name="contactID">Initial value of the ContactID property.</param>
        /// <param name="billToAddressID">Initial value of the BillToAddressID property.</param>
        /// <param name="shipToAddressID">Initial value of the ShipToAddressID property.</param>
        /// <param name="shipMethodID">Initial value of the ShipMethodID property.</param>
        /// <param name="subTotal">Initial value of the SubTotal property.</param>
        /// <param name="taxAmt">Initial value of the TaxAmt property.</param>
        /// <param name="freight">Initial value of the Freight property.</param>
        /// <param name="totalDue">Initial value of the TotalDue property.</param>
        /// <param name="rowguid">Initial value of the rowguid property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        /// <param name="salesOrderID1">Initial value of the SalesOrderID1 property.</param>
        /// <param name="salesOrderDetailID">Initial value of the SalesOrderDetailID property.</param>
        /// <param name="orderQty">Initial value of the OrderQty property.</param>
        /// <param name="productID">Initial value of the ProductID property.</param>
        /// <param name="specialOfferID">Initial value of the SpecialOfferID property.</param>
        /// <param name="unitPrice">Initial value of the UnitPrice property.</param>
        /// <param name="unitPriceDiscount">Initial value of the UnitPriceDiscount property.</param>
        /// <param name="lineTotal">Initial value of the LineTotal property.</param>
        /// <param name="rowguid1">Initial value of the rowguid1 property.</param>
        /// <param name="modifiedDate1">Initial value of the ModifiedDate1 property.</param>
        public static GetOrders_Result CreateGetOrders_Result(global::System.Int32 salesOrderID, global::System.Byte revisionNumber, global::System.DateTime orderDate, global::System.DateTime dueDate, global::System.Byte status, global::System.Boolean onlineOrderFlag, global::System.String salesOrderNumber, global::System.Int32 customerID, global::System.Int32 contactID, global::System.Int32 billToAddressID, global::System.Int32 shipToAddressID, global::System.Int32 shipMethodID, global::System.Decimal subTotal, global::System.Decimal taxAmt, global::System.Decimal freight, global::System.Decimal totalDue, global::System.Guid rowguid, global::System.DateTime modifiedDate, global::System.Int32 salesOrderID1, global::System.Int32 salesOrderDetailID, global::System.Int16 orderQty, global::System.Int32 productID, global::System.Int32 specialOfferID, global::System.Decimal unitPrice, global::System.Decimal unitPriceDiscount, global::System.Decimal lineTotal, global::System.Guid rowguid1, global::System.DateTime modifiedDate1)
        {
            GetOrders_Result getOrders_Result = new GetOrders_Result();
            getOrders_Result.SalesOrderID = salesOrderID;
            getOrders_Result.RevisionNumber = revisionNumber;
            getOrders_Result.OrderDate = orderDate;
            getOrders_Result.DueDate = dueDate;
            getOrders_Result.Status = status;
            getOrders_Result.OnlineOrderFlag = onlineOrderFlag;
            getOrders_Result.SalesOrderNumber = salesOrderNumber;
            getOrders_Result.CustomerID = customerID;
            getOrders_Result.ContactID = contactID;
            getOrders_Result.BillToAddressID = billToAddressID;
            getOrders_Result.ShipToAddressID = shipToAddressID;
            getOrders_Result.ShipMethodID = shipMethodID;
            getOrders_Result.SubTotal = subTotal;
            getOrders_Result.TaxAmt = taxAmt;
            getOrders_Result.Freight = freight;
            getOrders_Result.TotalDue = totalDue;
            getOrders_Result.rowguid = rowguid;
            getOrders_Result.ModifiedDate = modifiedDate;
            getOrders_Result.SalesOrderID1 = salesOrderID1;
            getOrders_Result.SalesOrderDetailID = salesOrderDetailID;
            getOrders_Result.OrderQty = orderQty;
            getOrders_Result.ProductID = productID;
            getOrders_Result.SpecialOfferID = specialOfferID;
            getOrders_Result.UnitPrice = unitPrice;
            getOrders_Result.UnitPriceDiscount = unitPriceDiscount;
            getOrders_Result.LineTotal = lineTotal;
            getOrders_Result.rowguid1 = rowguid1;
            getOrders_Result.ModifiedDate1 = modifiedDate1;
            return getOrders_Result;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 SalesOrderID
        {
            get
            {
                return _SalesOrderID;
            }
            set
            {
                OnSalesOrderIDChanging(value);
                ReportPropertyChanging("SalesOrderID");
                _SalesOrderID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("SalesOrderID");
                OnSalesOrderIDChanged();
            }
        }
        private global::System.Int32 _SalesOrderID;
        partial void OnSalesOrderIDChanging(global::System.Int32 value);
        partial void OnSalesOrderIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Byte RevisionNumber
        {
            get
            {
                return _RevisionNumber;
            }
            set
            {
                OnRevisionNumberChanging(value);
                ReportPropertyChanging("RevisionNumber");
                _RevisionNumber = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("RevisionNumber");
                OnRevisionNumberChanged();
            }
        }
        private global::System.Byte _RevisionNumber;
        partial void OnRevisionNumberChanging(global::System.Byte value);
        partial void OnRevisionNumberChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime OrderDate
        {
            get
            {
                return _OrderDate;
            }
            set
            {
                OnOrderDateChanging(value);
                ReportPropertyChanging("OrderDate");
                _OrderDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("OrderDate");
                OnOrderDateChanged();
            }
        }
        private global::System.DateTime _OrderDate;
        partial void OnOrderDateChanging(global::System.DateTime value);
        partial void OnOrderDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime DueDate
        {
            get
            {
                return _DueDate;
            }
            set
            {
                OnDueDateChanging(value);
                ReportPropertyChanging("DueDate");
                _DueDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("DueDate");
                OnDueDateChanged();
            }
        }
        private global::System.DateTime _DueDate;
        partial void OnDueDateChanging(global::System.DateTime value);
        partial void OnDueDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.DateTime> ShipDate
        {
            get
            {
                return _ShipDate;
            }
            set
            {
                OnShipDateChanging(value);
                ReportPropertyChanging("ShipDate");
                _ShipDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ShipDate");
                OnShipDateChanged();
            }
        }
        private Nullable<global::System.DateTime> _ShipDate;
        partial void OnShipDateChanging(Nullable<global::System.DateTime> value);
        partial void OnShipDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Byte Status
        {
            get
            {
                return _Status;
            }
            set
            {
                OnStatusChanging(value);
                ReportPropertyChanging("Status");
                _Status = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("Status");
                OnStatusChanged();
            }
        }
        private global::System.Byte _Status;
        partial void OnStatusChanging(global::System.Byte value);
        partial void OnStatusChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Boolean OnlineOrderFlag
        {
            get
            {
                return _OnlineOrderFlag;
            }
            set
            {
                OnOnlineOrderFlagChanging(value);
                ReportPropertyChanging("OnlineOrderFlag");
                _OnlineOrderFlag = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("OnlineOrderFlag");
                OnOnlineOrderFlagChanged();
            }
        }
        private global::System.Boolean _OnlineOrderFlag;
        partial void OnOnlineOrderFlagChanging(global::System.Boolean value);
        partial void OnOnlineOrderFlagChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String SalesOrderNumber
        {
            get
            {
                return _SalesOrderNumber;
            }
            set
            {
                OnSalesOrderNumberChanging(value);
                ReportPropertyChanging("SalesOrderNumber");
                _SalesOrderNumber = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("SalesOrderNumber");
                OnSalesOrderNumberChanged();
            }
        }
        private global::System.String _SalesOrderNumber;
        partial void OnSalesOrderNumberChanging(global::System.String value);
        partial void OnSalesOrderNumberChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String PurchaseOrderNumber
        {
            get
            {
                return _PurchaseOrderNumber;
            }
            set
            {
                OnPurchaseOrderNumberChanging(value);
                ReportPropertyChanging("PurchaseOrderNumber");
                _PurchaseOrderNumber = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("PurchaseOrderNumber");
                OnPurchaseOrderNumberChanged();
            }
        }
        private global::System.String _PurchaseOrderNumber;
        partial void OnPurchaseOrderNumberChanging(global::System.String value);
        partial void OnPurchaseOrderNumberChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String AccountNumber
        {
            get
            {
                return _AccountNumber;
            }
            set
            {
                OnAccountNumberChanging(value);
                ReportPropertyChanging("AccountNumber");
                _AccountNumber = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("AccountNumber");
                OnAccountNumberChanged();
            }
        }
        private global::System.String _AccountNumber;
        partial void OnAccountNumberChanging(global::System.String value);
        partial void OnAccountNumberChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 CustomerID
        {
            get
            {
                return _CustomerID;
            }
            set
            {
                OnCustomerIDChanging(value);
                ReportPropertyChanging("CustomerID");
                _CustomerID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("CustomerID");
                OnCustomerIDChanged();
            }
        }
        private global::System.Int32 _CustomerID;
        partial void OnCustomerIDChanging(global::System.Int32 value);
        partial void OnCustomerIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ContactID
        {
            get
            {
                return _ContactID;
            }
            set
            {
                OnContactIDChanging(value);
                ReportPropertyChanging("ContactID");
                _ContactID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ContactID");
                OnContactIDChanged();
            }
        }
        private global::System.Int32 _ContactID;
        partial void OnContactIDChanging(global::System.Int32 value);
        partial void OnContactIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> SalesPersonID
        {
            get
            {
                return _SalesPersonID;
            }
            set
            {
                OnSalesPersonIDChanging(value);
                ReportPropertyChanging("SalesPersonID");
                _SalesPersonID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("SalesPersonID");
                OnSalesPersonIDChanged();
            }
        }
        private Nullable<global::System.Int32> _SalesPersonID;
        partial void OnSalesPersonIDChanging(Nullable<global::System.Int32> value);
        partial void OnSalesPersonIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> TerritoryID
        {
            get
            {
                return _TerritoryID;
            }
            set
            {
                OnTerritoryIDChanging(value);
                ReportPropertyChanging("TerritoryID");
                _TerritoryID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("TerritoryID");
                OnTerritoryIDChanged();
            }
        }
        private Nullable<global::System.Int32> _TerritoryID;
        partial void OnTerritoryIDChanging(Nullable<global::System.Int32> value);
        partial void OnTerritoryIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 BillToAddressID
        {
            get
            {
                return _BillToAddressID;
            }
            set
            {
                OnBillToAddressIDChanging(value);
                ReportPropertyChanging("BillToAddressID");
                _BillToAddressID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("BillToAddressID");
                OnBillToAddressIDChanged();
            }
        }
        private global::System.Int32 _BillToAddressID;
        partial void OnBillToAddressIDChanging(global::System.Int32 value);
        partial void OnBillToAddressIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ShipToAddressID
        {
            get
            {
                return _ShipToAddressID;
            }
            set
            {
                OnShipToAddressIDChanging(value);
                ReportPropertyChanging("ShipToAddressID");
                _ShipToAddressID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ShipToAddressID");
                OnShipToAddressIDChanged();
            }
        }
        private global::System.Int32 _ShipToAddressID;
        partial void OnShipToAddressIDChanging(global::System.Int32 value);
        partial void OnShipToAddressIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ShipMethodID
        {
            get
            {
                return _ShipMethodID;
            }
            set
            {
                OnShipMethodIDChanging(value);
                ReportPropertyChanging("ShipMethodID");
                _ShipMethodID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ShipMethodID");
                OnShipMethodIDChanged();
            }
        }
        private global::System.Int32 _ShipMethodID;
        partial void OnShipMethodIDChanging(global::System.Int32 value);
        partial void OnShipMethodIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> CreditCardID
        {
            get
            {
                return _CreditCardID;
            }
            set
            {
                OnCreditCardIDChanging(value);
                ReportPropertyChanging("CreditCardID");
                _CreditCardID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("CreditCardID");
                OnCreditCardIDChanged();
            }
        }
        private Nullable<global::System.Int32> _CreditCardID;
        partial void OnCreditCardIDChanging(Nullable<global::System.Int32> value);
        partial void OnCreditCardIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String CreditCardApprovalCode
        {
            get
            {
                return _CreditCardApprovalCode;
            }
            set
            {
                OnCreditCardApprovalCodeChanging(value);
                ReportPropertyChanging("CreditCardApprovalCode");
                _CreditCardApprovalCode = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("CreditCardApprovalCode");
                OnCreditCardApprovalCodeChanged();
            }
        }
        private global::System.String _CreditCardApprovalCode;
        partial void OnCreditCardApprovalCodeChanging(global::System.String value);
        partial void OnCreditCardApprovalCodeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> CurrencyRateID
        {
            get
            {
                return _CurrencyRateID;
            }
            set
            {
                OnCurrencyRateIDChanging(value);
                ReportPropertyChanging("CurrencyRateID");
                _CurrencyRateID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("CurrencyRateID");
                OnCurrencyRateIDChanged();
            }
        }
        private Nullable<global::System.Int32> _CurrencyRateID;
        partial void OnCurrencyRateIDChanging(Nullable<global::System.Int32> value);
        partial void OnCurrencyRateIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal SubTotal
        {
            get
            {
                return _SubTotal;
            }
            set
            {
                OnSubTotalChanging(value);
                ReportPropertyChanging("SubTotal");
                _SubTotal = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("SubTotal");
                OnSubTotalChanged();
            }
        }
        private global::System.Decimal _SubTotal;
        partial void OnSubTotalChanging(global::System.Decimal value);
        partial void OnSubTotalChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal TaxAmt
        {
            get
            {
                return _TaxAmt;
            }
            set
            {
                OnTaxAmtChanging(value);
                ReportPropertyChanging("TaxAmt");
                _TaxAmt = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("TaxAmt");
                OnTaxAmtChanged();
            }
        }
        private global::System.Decimal _TaxAmt;
        partial void OnTaxAmtChanging(global::System.Decimal value);
        partial void OnTaxAmtChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal Freight
        {
            get
            {
                return _Freight;
            }
            set
            {
                OnFreightChanging(value);
                ReportPropertyChanging("Freight");
                _Freight = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("Freight");
                OnFreightChanged();
            }
        }
        private global::System.Decimal _Freight;
        partial void OnFreightChanging(global::System.Decimal value);
        partial void OnFreightChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal TotalDue
        {
            get
            {
                return _TotalDue;
            }
            set
            {
                OnTotalDueChanging(value);
                ReportPropertyChanging("TotalDue");
                _TotalDue = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("TotalDue");
                OnTotalDueChanged();
            }
        }
        private global::System.Decimal _TotalDue;
        partial void OnTotalDueChanging(global::System.Decimal value);
        partial void OnTotalDueChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String Comment
        {
            get
            {
                return _Comment;
            }
            set
            {
                OnCommentChanging(value);
                ReportPropertyChanging("Comment");
                _Comment = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("Comment");
                OnCommentChanged();
            }
        }
        private global::System.String _Comment;
        partial void OnCommentChanging(global::System.String value);
        partial void OnCommentChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Guid rowguid
        {
            get
            {
                return _rowguid;
            }
            set
            {
                OnrowguidChanging(value);
                ReportPropertyChanging("rowguid");
                _rowguid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("rowguid");
                OnrowguidChanged();
            }
        }
        private global::System.Guid _rowguid;
        partial void OnrowguidChanging(global::System.Guid value);
        partial void OnrowguidChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 SalesOrderID1
        {
            get
            {
                return _SalesOrderID1;
            }
            set
            {
                OnSalesOrderID1Changing(value);
                ReportPropertyChanging("SalesOrderID1");
                _SalesOrderID1 = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("SalesOrderID1");
                OnSalesOrderID1Changed();
            }
        }
        private global::System.Int32 _SalesOrderID1;
        partial void OnSalesOrderID1Changing(global::System.Int32 value);
        partial void OnSalesOrderID1Changed();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 SalesOrderDetailID
        {
            get
            {
                return _SalesOrderDetailID;
            }
            set
            {
                OnSalesOrderDetailIDChanging(value);
                ReportPropertyChanging("SalesOrderDetailID");
                _SalesOrderDetailID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("SalesOrderDetailID");
                OnSalesOrderDetailIDChanged();
            }
        }
        private global::System.Int32 _SalesOrderDetailID;
        partial void OnSalesOrderDetailIDChanging(global::System.Int32 value);
        partial void OnSalesOrderDetailIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String CarrierTrackingNumber
        {
            get
            {
                return _CarrierTrackingNumber;
            }
            set
            {
                OnCarrierTrackingNumberChanging(value);
                ReportPropertyChanging("CarrierTrackingNumber");
                _CarrierTrackingNumber = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("CarrierTrackingNumber");
                OnCarrierTrackingNumberChanged();
            }
        }
        private global::System.String _CarrierTrackingNumber;
        partial void OnCarrierTrackingNumberChanging(global::System.String value);
        partial void OnCarrierTrackingNumberChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int16 OrderQty
        {
            get
            {
                return _OrderQty;
            }
            set
            {
                OnOrderQtyChanging(value);
                ReportPropertyChanging("OrderQty");
                _OrderQty = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("OrderQty");
                OnOrderQtyChanged();
            }
        }
        private global::System.Int16 _OrderQty;
        partial void OnOrderQtyChanging(global::System.Int16 value);
        partial void OnOrderQtyChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ProductID
        {
            get
            {
                return _ProductID;
            }
            set
            {
                OnProductIDChanging(value);
                ReportPropertyChanging("ProductID");
                _ProductID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ProductID");
                OnProductIDChanged();
            }
        }
        private global::System.Int32 _ProductID;
        partial void OnProductIDChanging(global::System.Int32 value);
        partial void OnProductIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 SpecialOfferID
        {
            get
            {
                return _SpecialOfferID;
            }
            set
            {
                OnSpecialOfferIDChanging(value);
                ReportPropertyChanging("SpecialOfferID");
                _SpecialOfferID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("SpecialOfferID");
                OnSpecialOfferIDChanged();
            }
        }
        private global::System.Int32 _SpecialOfferID;
        partial void OnSpecialOfferIDChanging(global::System.Int32 value);
        partial void OnSpecialOfferIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal UnitPrice
        {
            get
            {
                return _UnitPrice;
            }
            set
            {
                OnUnitPriceChanging(value);
                ReportPropertyChanging("UnitPrice");
                _UnitPrice = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("UnitPrice");
                OnUnitPriceChanged();
            }
        }
        private global::System.Decimal _UnitPrice;
        partial void OnUnitPriceChanging(global::System.Decimal value);
        partial void OnUnitPriceChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal UnitPriceDiscount
        {
            get
            {
                return _UnitPriceDiscount;
            }
            set
            {
                OnUnitPriceDiscountChanging(value);
                ReportPropertyChanging("UnitPriceDiscount");
                _UnitPriceDiscount = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("UnitPriceDiscount");
                OnUnitPriceDiscountChanged();
            }
        }
        private global::System.Decimal _UnitPriceDiscount;
        partial void OnUnitPriceDiscountChanging(global::System.Decimal value);
        partial void OnUnitPriceDiscountChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal LineTotal
        {
            get
            {
                return _LineTotal;
            }
            set
            {
                OnLineTotalChanging(value);
                ReportPropertyChanging("LineTotal");
                _LineTotal = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("LineTotal");
                OnLineTotalChanged();
            }
        }
        private global::System.Decimal _LineTotal;
        partial void OnLineTotalChanging(global::System.Decimal value);
        partial void OnLineTotalChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Guid rowguid1
        {
            get
            {
                return _rowguid1;
            }
            set
            {
                Onrowguid1Changing(value);
                ReportPropertyChanging("rowguid1");
                _rowguid1 = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("rowguid1");
                Onrowguid1Changed();
            }
        }
        private global::System.Guid _rowguid1;
        partial void Onrowguid1Changing(global::System.Guid value);
        partial void Onrowguid1Changed();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate1
        {
            get
            {
                return _ModifiedDate1;
            }
            set
            {
                OnModifiedDate1Changing(value);
                ReportPropertyChanging("ModifiedDate1");
                _ModifiedDate1 = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate1");
                OnModifiedDate1Changed();
            }
        }
        private global::System.DateTime _ModifiedDate1;
        partial void OnModifiedDate1Changing(global::System.DateTime value);
        partial void OnModifiedDate1Changed();

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmComplexTypeAttribute(NamespaceName="AdventureWorksModel", Name="GetOrdersHeader_Result")]
    [DataContractAttribute(IsReference=true)]
    [Serializable()]
    public partial class GetOrdersHeader_Result : ComplexObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new GetOrdersHeader_Result object.
        /// </summary>
        /// <param name="salesOrderID">Initial value of the SalesOrderID property.</param>
        /// <param name="revisionNumber">Initial value of the RevisionNumber property.</param>
        /// <param name="orderDate">Initial value of the OrderDate property.</param>
        /// <param name="dueDate">Initial value of the DueDate property.</param>
        /// <param name="status">Initial value of the Status property.</param>
        /// <param name="onlineOrderFlag">Initial value of the OnlineOrderFlag property.</param>
        /// <param name="salesOrderNumber">Initial value of the SalesOrderNumber property.</param>
        /// <param name="customerID">Initial value of the CustomerID property.</param>
        /// <param name="contactID">Initial value of the ContactID property.</param>
        /// <param name="billToAddressID">Initial value of the BillToAddressID property.</param>
        /// <param name="shipToAddressID">Initial value of the ShipToAddressID property.</param>
        /// <param name="shipMethodID">Initial value of the ShipMethodID property.</param>
        /// <param name="subTotal">Initial value of the SubTotal property.</param>
        /// <param name="taxAmt">Initial value of the TaxAmt property.</param>
        /// <param name="freight">Initial value of the Freight property.</param>
        /// <param name="totalDue">Initial value of the TotalDue property.</param>
        /// <param name="rowguid">Initial value of the rowguid property.</param>
        /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
        /// <param name="salesOrderDetailID">Initial value of the SalesOrderDetailID property.</param>
        public static GetOrdersHeader_Result CreateGetOrdersHeader_Result(global::System.Int32 salesOrderID, global::System.Byte revisionNumber, global::System.DateTime orderDate, global::System.DateTime dueDate, global::System.Byte status, global::System.Boolean onlineOrderFlag, global::System.String salesOrderNumber, global::System.Int32 customerID, global::System.Int32 contactID, global::System.Int32 billToAddressID, global::System.Int32 shipToAddressID, global::System.Int32 shipMethodID, global::System.Decimal subTotal, global::System.Decimal taxAmt, global::System.Decimal freight, global::System.Decimal totalDue, global::System.Guid rowguid, global::System.DateTime modifiedDate, global::System.Int32 salesOrderDetailID)
        {
            GetOrdersHeader_Result getOrdersHeader_Result = new GetOrdersHeader_Result();
            getOrdersHeader_Result.SalesOrderID = salesOrderID;
            getOrdersHeader_Result.RevisionNumber = revisionNumber;
            getOrdersHeader_Result.OrderDate = orderDate;
            getOrdersHeader_Result.DueDate = dueDate;
            getOrdersHeader_Result.Status = status;
            getOrdersHeader_Result.OnlineOrderFlag = onlineOrderFlag;
            getOrdersHeader_Result.SalesOrderNumber = salesOrderNumber;
            getOrdersHeader_Result.CustomerID = customerID;
            getOrdersHeader_Result.ContactID = contactID;
            getOrdersHeader_Result.BillToAddressID = billToAddressID;
            getOrdersHeader_Result.ShipToAddressID = shipToAddressID;
            getOrdersHeader_Result.ShipMethodID = shipMethodID;
            getOrdersHeader_Result.SubTotal = subTotal;
            getOrdersHeader_Result.TaxAmt = taxAmt;
            getOrdersHeader_Result.Freight = freight;
            getOrdersHeader_Result.TotalDue = totalDue;
            getOrdersHeader_Result.rowguid = rowguid;
            getOrdersHeader_Result.ModifiedDate = modifiedDate;
            getOrdersHeader_Result.SalesOrderDetailID = salesOrderDetailID;
            return getOrdersHeader_Result;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 SalesOrderID
        {
            get
            {
                return _SalesOrderID;
            }
            set
            {
                OnSalesOrderIDChanging(value);
                ReportPropertyChanging("SalesOrderID");
                _SalesOrderID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("SalesOrderID");
                OnSalesOrderIDChanged();
            }
        }
        private global::System.Int32 _SalesOrderID;
        partial void OnSalesOrderIDChanging(global::System.Int32 value);
        partial void OnSalesOrderIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Byte RevisionNumber
        {
            get
            {
                return _RevisionNumber;
            }
            set
            {
                OnRevisionNumberChanging(value);
                ReportPropertyChanging("RevisionNumber");
                _RevisionNumber = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("RevisionNumber");
                OnRevisionNumberChanged();
            }
        }
        private global::System.Byte _RevisionNumber;
        partial void OnRevisionNumberChanging(global::System.Byte value);
        partial void OnRevisionNumberChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime OrderDate
        {
            get
            {
                return _OrderDate;
            }
            set
            {
                OnOrderDateChanging(value);
                ReportPropertyChanging("OrderDate");
                _OrderDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("OrderDate");
                OnOrderDateChanged();
            }
        }
        private global::System.DateTime _OrderDate;
        partial void OnOrderDateChanging(global::System.DateTime value);
        partial void OnOrderDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime DueDate
        {
            get
            {
                return _DueDate;
            }
            set
            {
                OnDueDateChanging(value);
                ReportPropertyChanging("DueDate");
                _DueDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("DueDate");
                OnDueDateChanged();
            }
        }
        private global::System.DateTime _DueDate;
        partial void OnDueDateChanging(global::System.DateTime value);
        partial void OnDueDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.DateTime> ShipDate
        {
            get
            {
                return _ShipDate;
            }
            set
            {
                OnShipDateChanging(value);
                ReportPropertyChanging("ShipDate");
                _ShipDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ShipDate");
                OnShipDateChanged();
            }
        }
        private Nullable<global::System.DateTime> _ShipDate;
        partial void OnShipDateChanging(Nullable<global::System.DateTime> value);
        partial void OnShipDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Byte Status
        {
            get
            {
                return _Status;
            }
            set
            {
                OnStatusChanging(value);
                ReportPropertyChanging("Status");
                _Status = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("Status");
                OnStatusChanged();
            }
        }
        private global::System.Byte _Status;
        partial void OnStatusChanging(global::System.Byte value);
        partial void OnStatusChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Boolean OnlineOrderFlag
        {
            get
            {
                return _OnlineOrderFlag;
            }
            set
            {
                OnOnlineOrderFlagChanging(value);
                ReportPropertyChanging("OnlineOrderFlag");
                _OnlineOrderFlag = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("OnlineOrderFlag");
                OnOnlineOrderFlagChanged();
            }
        }
        private global::System.Boolean _OnlineOrderFlag;
        partial void OnOnlineOrderFlagChanging(global::System.Boolean value);
        partial void OnOnlineOrderFlagChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String SalesOrderNumber
        {
            get
            {
                return _SalesOrderNumber;
            }
            set
            {
                OnSalesOrderNumberChanging(value);
                ReportPropertyChanging("SalesOrderNumber");
                _SalesOrderNumber = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("SalesOrderNumber");
                OnSalesOrderNumberChanged();
            }
        }
        private global::System.String _SalesOrderNumber;
        partial void OnSalesOrderNumberChanging(global::System.String value);
        partial void OnSalesOrderNumberChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String PurchaseOrderNumber
        {
            get
            {
                return _PurchaseOrderNumber;
            }
            set
            {
                OnPurchaseOrderNumberChanging(value);
                ReportPropertyChanging("PurchaseOrderNumber");
                _PurchaseOrderNumber = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("PurchaseOrderNumber");
                OnPurchaseOrderNumberChanged();
            }
        }
        private global::System.String _PurchaseOrderNumber;
        partial void OnPurchaseOrderNumberChanging(global::System.String value);
        partial void OnPurchaseOrderNumberChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String AccountNumber
        {
            get
            {
                return _AccountNumber;
            }
            set
            {
                OnAccountNumberChanging(value);
                ReportPropertyChanging("AccountNumber");
                _AccountNumber = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("AccountNumber");
                OnAccountNumberChanged();
            }
        }
        private global::System.String _AccountNumber;
        partial void OnAccountNumberChanging(global::System.String value);
        partial void OnAccountNumberChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 CustomerID
        {
            get
            {
                return _CustomerID;
            }
            set
            {
                OnCustomerIDChanging(value);
                ReportPropertyChanging("CustomerID");
                _CustomerID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("CustomerID");
                OnCustomerIDChanged();
            }
        }
        private global::System.Int32 _CustomerID;
        partial void OnCustomerIDChanging(global::System.Int32 value);
        partial void OnCustomerIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ContactID
        {
            get
            {
                return _ContactID;
            }
            set
            {
                OnContactIDChanging(value);
                ReportPropertyChanging("ContactID");
                _ContactID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ContactID");
                OnContactIDChanged();
            }
        }
        private global::System.Int32 _ContactID;
        partial void OnContactIDChanging(global::System.Int32 value);
        partial void OnContactIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> SalesPersonID
        {
            get
            {
                return _SalesPersonID;
            }
            set
            {
                OnSalesPersonIDChanging(value);
                ReportPropertyChanging("SalesPersonID");
                _SalesPersonID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("SalesPersonID");
                OnSalesPersonIDChanged();
            }
        }
        private Nullable<global::System.Int32> _SalesPersonID;
        partial void OnSalesPersonIDChanging(Nullable<global::System.Int32> value);
        partial void OnSalesPersonIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> TerritoryID
        {
            get
            {
                return _TerritoryID;
            }
            set
            {
                OnTerritoryIDChanging(value);
                ReportPropertyChanging("TerritoryID");
                _TerritoryID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("TerritoryID");
                OnTerritoryIDChanged();
            }
        }
        private Nullable<global::System.Int32> _TerritoryID;
        partial void OnTerritoryIDChanging(Nullable<global::System.Int32> value);
        partial void OnTerritoryIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 BillToAddressID
        {
            get
            {
                return _BillToAddressID;
            }
            set
            {
                OnBillToAddressIDChanging(value);
                ReportPropertyChanging("BillToAddressID");
                _BillToAddressID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("BillToAddressID");
                OnBillToAddressIDChanged();
            }
        }
        private global::System.Int32 _BillToAddressID;
        partial void OnBillToAddressIDChanging(global::System.Int32 value);
        partial void OnBillToAddressIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ShipToAddressID
        {
            get
            {
                return _ShipToAddressID;
            }
            set
            {
                OnShipToAddressIDChanging(value);
                ReportPropertyChanging("ShipToAddressID");
                _ShipToAddressID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ShipToAddressID");
                OnShipToAddressIDChanged();
            }
        }
        private global::System.Int32 _ShipToAddressID;
        partial void OnShipToAddressIDChanging(global::System.Int32 value);
        partial void OnShipToAddressIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ShipMethodID
        {
            get
            {
                return _ShipMethodID;
            }
            set
            {
                OnShipMethodIDChanging(value);
                ReportPropertyChanging("ShipMethodID");
                _ShipMethodID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ShipMethodID");
                OnShipMethodIDChanged();
            }
        }
        private global::System.Int32 _ShipMethodID;
        partial void OnShipMethodIDChanging(global::System.Int32 value);
        partial void OnShipMethodIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> CreditCardID
        {
            get
            {
                return _CreditCardID;
            }
            set
            {
                OnCreditCardIDChanging(value);
                ReportPropertyChanging("CreditCardID");
                _CreditCardID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("CreditCardID");
                OnCreditCardIDChanged();
            }
        }
        private Nullable<global::System.Int32> _CreditCardID;
        partial void OnCreditCardIDChanging(Nullable<global::System.Int32> value);
        partial void OnCreditCardIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String CreditCardApprovalCode
        {
            get
            {
                return _CreditCardApprovalCode;
            }
            set
            {
                OnCreditCardApprovalCodeChanging(value);
                ReportPropertyChanging("CreditCardApprovalCode");
                _CreditCardApprovalCode = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("CreditCardApprovalCode");
                OnCreditCardApprovalCodeChanged();
            }
        }
        private global::System.String _CreditCardApprovalCode;
        partial void OnCreditCardApprovalCodeChanging(global::System.String value);
        partial void OnCreditCardApprovalCodeChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> CurrencyRateID
        {
            get
            {
                return _CurrencyRateID;
            }
            set
            {
                OnCurrencyRateIDChanging(value);
                ReportPropertyChanging("CurrencyRateID");
                _CurrencyRateID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("CurrencyRateID");
                OnCurrencyRateIDChanged();
            }
        }
        private Nullable<global::System.Int32> _CurrencyRateID;
        partial void OnCurrencyRateIDChanging(Nullable<global::System.Int32> value);
        partial void OnCurrencyRateIDChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal SubTotal
        {
            get
            {
                return _SubTotal;
            }
            set
            {
                OnSubTotalChanging(value);
                ReportPropertyChanging("SubTotal");
                _SubTotal = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("SubTotal");
                OnSubTotalChanged();
            }
        }
        private global::System.Decimal _SubTotal;
        partial void OnSubTotalChanging(global::System.Decimal value);
        partial void OnSubTotalChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal TaxAmt
        {
            get
            {
                return _TaxAmt;
            }
            set
            {
                OnTaxAmtChanging(value);
                ReportPropertyChanging("TaxAmt");
                _TaxAmt = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("TaxAmt");
                OnTaxAmtChanged();
            }
        }
        private global::System.Decimal _TaxAmt;
        partial void OnTaxAmtChanging(global::System.Decimal value);
        partial void OnTaxAmtChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal Freight
        {
            get
            {
                return _Freight;
            }
            set
            {
                OnFreightChanging(value);
                ReportPropertyChanging("Freight");
                _Freight = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("Freight");
                OnFreightChanged();
            }
        }
        private global::System.Decimal _Freight;
        partial void OnFreightChanging(global::System.Decimal value);
        partial void OnFreightChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Decimal TotalDue
        {
            get
            {
                return _TotalDue;
            }
            set
            {
                OnTotalDueChanging(value);
                ReportPropertyChanging("TotalDue");
                _TotalDue = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("TotalDue");
                OnTotalDueChanged();
            }
        }
        private global::System.Decimal _TotalDue;
        partial void OnTotalDueChanging(global::System.Decimal value);
        partial void OnTotalDueChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String Comment
        {
            get
            {
                return _Comment;
            }
            set
            {
                OnCommentChanging(value);
                ReportPropertyChanging("Comment");
                _Comment = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("Comment");
                OnCommentChanged();
            }
        }
        private global::System.String _Comment;
        partial void OnCommentChanging(global::System.String value);
        partial void OnCommentChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Guid rowguid
        {
            get
            {
                return _rowguid;
            }
            set
            {
                OnrowguidChanging(value);
                ReportPropertyChanging("rowguid");
                _rowguid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("rowguid");
                OnrowguidChanged();
            }
        }
        private global::System.Guid _rowguid;
        partial void OnrowguidChanging(global::System.Guid value);
        partial void OnrowguidChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.DateTime ModifiedDate
        {
            get
            {
                return _ModifiedDate;
            }
            set
            {
                OnModifiedDateChanging(value);
                ReportPropertyChanging("ModifiedDate");
                _ModifiedDate = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ModifiedDate");
                OnModifiedDateChanged();
            }
        }
        private global::System.DateTime _ModifiedDate;
        partial void OnModifiedDateChanging(global::System.DateTime value);
        partial void OnModifiedDateChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 SalesOrderDetailID
        {
            get
            {
                return _SalesOrderDetailID;
            }
            set
            {
                OnSalesOrderDetailIDChanging(value);
                ReportPropertyChanging("SalesOrderDetailID");
                _SalesOrderDetailID = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("SalesOrderDetailID");
                OnSalesOrderDetailIDChanged();
            }
        }
        private global::System.Int32 _SalesOrderDetailID;
        partial void OnSalesOrderDetailIDChanging(global::System.Int32 value);
        partial void OnSalesOrderDetailIDChanged();

        #endregion
    }

    #endregion
    
}
