//------------------------------------------------------------------------------
// <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_SalesOrderHeader_Customer_CustomerID", "Customer", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(C1DataGrid_WCF_DSWeb.Customer), "SalesOrderHeader", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(C1DataGrid_WCF_DSWeb.SalesOrderHeader))]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_Product_ProductCategory_ProductCategoryID", "ProductCategory", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(C1DataGrid_WCF_DSWeb.ProductCategory), "Product", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(C1DataGrid_WCF_DSWeb.Product))]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_Product_ProductModel_ProductModelID", "ProductModel", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(C1DataGrid_WCF_DSWeb.ProductModel), "Product", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(C1DataGrid_WCF_DSWeb.Product))]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_SalesOrderDetail_Product_ProductID", "Product", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(C1DataGrid_WCF_DSWeb.Product), "SalesOrderDetail", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(C1DataGrid_WCF_DSWeb.SalesOrderDetail))]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_ProductCategory_ProductCategory_ParentProductCategoryID_ProductCategoryID", "ProductCategory", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(C1DataGrid_WCF_DSWeb.ProductCategory), "ProductCategory1", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(C1DataGrid_WCF_DSWeb.ProductCategory))]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_ProductModelProductDescription_ProductDescription_ProductDescriptionID", "ProductDescription", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(C1DataGrid_WCF_DSWeb.ProductDescription), "ProductModelProductDescription", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(C1DataGrid_WCF_DSWeb.ProductModelProductDescription), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_ProductModelProductDescription_ProductModel_ProductModelID", "ProductModel", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(C1DataGrid_WCF_DSWeb.ProductModel), "ProductModelProductDescription", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(C1DataGrid_WCF_DSWeb.ProductModelProductDescription), true)]
[assembly: EdmRelationshipAttribute("AdventureWorksModel", "FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderHeader", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(C1DataGrid_WCF_DSWeb.SalesOrderHeader), "SalesOrderDetail", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(C1DataGrid_WCF_DSWeb.SalesOrderDetail), true)]

#endregion

namespace C1DataGrid_WCF_DSWeb
{
    #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")
        {
            OnContextCreated();
        }
    
        /// <summary>
        /// Initialize a new AdventureWorksEntities object.
        /// </summary>
        public AdventureWorksEntities(string connectionString) : base(connectionString, "AdventureWorksEntities")
        {
            OnContextCreated();
        }
    
        /// <summary>
        /// Initialize a new AdventureWorksEntities object.
        /// </summary>
        public AdventureWorksEntities(EntityConnection connection) : base(connection, "AdventureWorksEntities")
        {
            OnContextCreated();
        }
    
        #endregion
    
        #region Partial Methods
    
        partial void OnContextCreated();
    
        #endregion
    
        #region ObjectSet Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<Customer> Customer
        {
            get
            {
                if ((_Customer == null))
                {
                    _Customer = base.CreateObjectSet<Customer>("Customer");
                }
                return _Customer;
            }
        }
        private ObjectSet<Customer> _Customer;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<Product> Product
        {
            get
            {
                if ((_Product == null))
                {
                    _Product = base.CreateObjectSet<Product>("Product");
                }
                return _Product;
            }
        }
        private ObjectSet<Product> _Product;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<ProductCategory> ProductCategory
        {
            get
            {
                if ((_ProductCategory == null))
                {
                    _ProductCategory = base.CreateObjectSet<ProductCategory>("ProductCategory");
                }
                return _ProductCategory;
            }
        }
        private ObjectSet<ProductCategory> _ProductCategory;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<ProductDescription> ProductDescription
        {
            get
            {
                if ((_ProductDescription == null))
                {
                    _ProductDescription = base.CreateObjectSet<ProductDescription>("ProductDescription");
                }
                return _ProductDescription;
            }
        }
        private ObjectSet<ProductDescription> _ProductDescription;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<ProductModel> ProductModel
        {
            get
            {
                if ((_ProductModel == null))
                {
                    _ProductModel = base.CreateObjectSet<ProductModel>("ProductModel");
                }
                return _ProductModel;
            }
        }
        private ObjectSet<ProductModel> _ProductModel;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<ProductModelProductDescription> ProductModelProductDescription
        {
            get
            {
                if ((_ProductModelProductDescription == null))
                {
                    _ProductModelProductDescription = base.CreateObjectSet<ProductModelProductDescription>("ProductModelProductDescription");
                }
                return _ProductModelProductDescription;
            }
        }
        private ObjectSet<ProductModelProductDescription> _ProductModelProductDescription;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<SalesOrderDetail> SalesOrderDetail
        {
            get
            {
                if ((_SalesOrderDetail == null))
                {
                    _SalesOrderDetail = base.CreateObjectSet<SalesOrderDetail>("SalesOrderDetail");
                }
                return _SalesOrderDetail;
            }
        }
        private ObjectSet<SalesOrderDetail> _SalesOrderDetail;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<SalesOrderHeader> SalesOrderHeader
        {
            get
            {
                if ((_SalesOrderHeader == null))
                {
                    _SalesOrderHeader = base.CreateObjectSet<SalesOrderHeader>("SalesOrderHeader");
                }
                return _SalesOrderHeader;
            }
        }
        private ObjectSet<SalesOrderHeader> _SalesOrderHeader;

        #endregion
        #region AddTo Methods
    
        /// <summary>
        /// Deprecated Method for adding a new object to the Customer EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToCustomer(Customer customer)
        {
            base.AddObject("Customer", customer);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the Product EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToProduct(Product product)
        {
            base.AddObject("Product", product);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the ProductCategory EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToProductCategory(ProductCategory productCategory)
        {
            base.AddObject("ProductCategory", productCategory);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the ProductDescription EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToProductDescription(ProductDescription productDescription)
        {
            base.AddObject("ProductDescription", productDescription);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the ProductModel EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToProductModel(ProductModel productModel)
        {
            base.AddObject("ProductModel", productModel);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the ProductModelProductDescription EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToProductModelProductDescription(ProductModelProductDescription productModelProductDescription)
        {
            base.AddObject("ProductModelProductDescription", productModelProductDescription);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the SalesOrderDetail EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToSalesOrderDetail(SalesOrderDetail salesOrderDetail)
        {
            base.AddObject("SalesOrderDetail", salesOrderDetail);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the SalesOrderHeader EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToSalesOrderHeader(SalesOrderHeader salesOrderHeader)
        {
            base.AddObject("SalesOrderHeader", salesOrderHeader);
        }

        #endregion
    }
    

    #endregion
    
    #region Entities
    
    /// <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="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="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.Boolean nameStyle, global::System.String firstName, global::System.String lastName, global::System.Guid rowguid, global::System.DateTime modifiedDate)
        {
            Customer customer = new Customer();
            customer.CustomerID = customerID;
            customer.NameStyle = nameStyle;
            customer.FirstName = firstName;
            customer.LastName = lastName;
            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=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 CompanyName
        {
            get
            {
                return _CompanyName;
            }
            set
            {
                OnCompanyNameChanging(value);
                ReportPropertyChanging("CompanyName");
                _CompanyName = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("CompanyName");
                OnCompanyNameChanged();
            }
        }
        private global::System.String _CompanyName;
        partial void OnCompanyNameChanging(global::System.String value);
        partial void OnCompanyNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String SalesPerson
        {
            get
            {
                return _SalesPerson;
            }
            set
            {
                OnSalesPersonChanging(value);
                ReportPropertyChanging("SalesPerson");
                _SalesPerson = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("SalesPerson");
                OnSalesPersonChanged();
            }
        }
        private global::System.String _SalesPerson;
        partial void OnSalesPersonChanging(global::System.String value);
        partial void OnSalesPersonChanged();
    
        /// <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=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.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_Customer_CustomerID", "SalesOrderHeader")]
        public EntityCollection<SalesOrderHeader> SalesOrderHeader
        {
            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);
                }
            }
        }

        #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="standardCost">Initial value of the StandardCost property.</param>
        /// <param name="listPrice">Initial value of the ListPrice 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.Decimal standardCost, global::System.Decimal listPrice, 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.StandardCost = standardCost;
            product.ListPrice = listPrice;
            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=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.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 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.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=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=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_ProductCategory_ProductCategoryID", "ProductCategory")]
        public ProductCategory ProductCategory
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductCategory>("AdventureWorksModel.FK_Product_ProductCategory_ProductCategoryID", "ProductCategory").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductCategory>("AdventureWorksModel.FK_Product_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_Product_ProductCategory_ProductCategoryID", "ProductCategory");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<ProductCategory>("AdventureWorksModel.FK_Product_ProductCategory_ProductCategoryID", "ProductCategory", 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_SalesOrderDetail_Product_ProductID", "SalesOrderDetail")]
        public EntityCollection<SalesOrderDetail> SalesOrderDetail
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<SalesOrderDetail>("AdventureWorksModel.FK_SalesOrderDetail_Product_ProductID", "SalesOrderDetail");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<SalesOrderDetail>("AdventureWorksModel.FK_SalesOrderDetail_Product_ProductID", "SalesOrderDetail", 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_Product_ProductCategory_ProductCategoryID", "Product")]
        public EntityCollection<Product> Product
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<Product>("AdventureWorksModel.FK_Product_ProductCategory_ProductCategoryID", "Product");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<Product>("AdventureWorksModel.FK_Product_ProductCategory_ProductCategoryID", "Product", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductCategory_ProductCategory_ParentProductCategoryID_ProductCategoryID", "ProductCategory1")]
        public EntityCollection<ProductCategory> ProductCategory1
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<ProductCategory>("AdventureWorksModel.FK_ProductCategory_ProductCategory_ParentProductCategoryID_ProductCategoryID", "ProductCategory1");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<ProductCategory>("AdventureWorksModel.FK_ProductCategory_ProductCategory_ParentProductCategoryID_ProductCategoryID", "ProductCategory1", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductCategory_ProductCategory_ParentProductCategoryID_ProductCategoryID", "ProductCategory")]
        public ProductCategory ProductCategory2
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductCategory>("AdventureWorksModel.FK_ProductCategory_ProductCategory_ParentProductCategoryID_ProductCategoryID", "ProductCategory").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductCategory>("AdventureWorksModel.FK_ProductCategory_ProductCategory_ParentProductCategoryID_ProductCategoryID", "ProductCategory").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<ProductCategory> ProductCategory2Reference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductCategory>("AdventureWorksModel.FK_ProductCategory_ProductCategory_ParentProductCategoryID_ProductCategoryID", "ProductCategory");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<ProductCategory>("AdventureWorksModel.FK_ProductCategory_ProductCategory_ParentProductCategoryID_ProductCategoryID", "ProductCategory", 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_ProductModelProductDescription_ProductDescription_ProductDescriptionID", "ProductModelProductDescription")]
        public EntityCollection<ProductModelProductDescription> ProductModelProductDescription
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<ProductModelProductDescription>("AdventureWorksModel.FK_ProductModelProductDescription_ProductDescription_ProductDescriptionID", "ProductModelProductDescription");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<ProductModelProductDescription>("AdventureWorksModel.FK_ProductModelProductDescription_ProductDescription_ProductDescriptionID", "ProductModelProductDescription", 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=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> Product
        {
            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_ProductModelProductDescription_ProductModel_ProductModelID", "ProductModelProductDescription")]
        public EntityCollection<ProductModelProductDescription> ProductModelProductDescription
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<ProductModelProductDescription>("AdventureWorksModel.FK_ProductModelProductDescription_ProductModel_ProductModelID", "ProductModelProductDescription");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<ProductModelProductDescription>("AdventureWorksModel.FK_ProductModelProductDescription_ProductModel_ProductModelID", "ProductModelProductDescription", value);
                }
            }
        }

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

        #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 Culture
        {
            get
            {
                return _Culture;
            }
            set
            {
                if (_Culture != value)
                {
                    OnCultureChanging(value);
                    ReportPropertyChanging("Culture");
                    _Culture = StructuralObject.SetValidValue(value, false);
                    ReportPropertyChanged("Culture");
                    OnCultureChanged();
                }
            }
        }
        private global::System.String _Culture;
        partial void OnCultureChanging(global::System.String value);
        partial void OnCultureChanged();
    
        /// <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_ProductModelProductDescription_ProductDescription_ProductDescriptionID", "ProductDescription")]
        public ProductDescription ProductDescription
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductDescription>("AdventureWorksModel.FK_ProductModelProductDescription_ProductDescription_ProductDescriptionID", "ProductDescription").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductDescription>("AdventureWorksModel.FK_ProductModelProductDescription_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_ProductModelProductDescription_ProductDescription_ProductDescriptionID", "ProductDescription");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<ProductDescription>("AdventureWorksModel.FK_ProductModelProductDescription_ProductDescription_ProductDescriptionID", "ProductDescription", value);
                }
            }
        }
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_ProductModelProductDescription_ProductModel_ProductModelID", "ProductModel")]
        public ProductModel ProductModel
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductModel>("AdventureWorksModel.FK_ProductModelProductDescription_ProductModel_ProductModelID", "ProductModel").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ProductModel>("AdventureWorksModel.FK_ProductModelProductDescription_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_ProductModelProductDescription_ProductModel_ProductModelID", "ProductModel");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<ProductModel>("AdventureWorksModel.FK_ProductModelProductDescription_ProductModel_ProductModelID", "ProductModel", 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="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.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.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=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.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_Product_ProductID", "Product")]
        public Product Product
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_SalesOrderDetail_Product_ProductID", "Product").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Product>("AdventureWorksModel.FK_SalesOrderDetail_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_SalesOrderDetail_Product_ProductID", "Product");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Product>("AdventureWorksModel.FK_SalesOrderDetail_Product_ProductID", "Product", value);
                }
            }
        }
    
        /// <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);
                }
            }
        }

        #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="shipMethod">Initial value of the ShipMethod 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.String shipMethod, 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.ShipMethod = shipMethod;
            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, 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.String ShipMethod
        {
            get
            {
                return _ShipMethod;
            }
            set
            {
                OnShipMethodChanging(value);
                ReportPropertyChanging("ShipMethod");
                _ShipMethod = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("ShipMethod");
                OnShipMethodChanged();
            }
        }
        private global::System.String _ShipMethod;
        partial void OnShipMethodChanging(global::System.String value);
        partial void OnShipMethodChanged();
    
        /// <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=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_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> SalesOrderDetail
        {
            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);
                }
            }
        }

        #endregion
    }

    #endregion
    
}
