//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.3053
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

// Original file name:
// Generation date: 14.10.2008 12:49:12
namespace NorthwindClient.NorthwindService
{
    
    /// <summary>
    /// There are no comments for NorthwindEntities in the schema.
    /// </summary>
    public partial class NorthwindEntities : global::System.Data.Services.Client.DataServiceContext
    {
        /// <summary>
        /// Initialize a new NorthwindEntities object.
        /// </summary>
        public NorthwindEntities(global::System.Uri serviceRoot) : 
                base(serviceRoot)
        {
            this.ResolveName = new global::System.Func<global::System.Type, string>(this.ResolveNameFromType);
            this.ResolveType = new global::System.Func<string, global::System.Type>(this.ResolveTypeFromName);
            this.OnContextCreated();
        }
        partial void OnContextCreated();
        /// <summary>
        /// Since the namespace configured for this service reference
        /// in Visual Studio is different from the one indicated in the
        /// server schema, use type-mappers to map between the two.
        /// </summary>
        protected global::System.Type ResolveTypeFromName(string typeName)
        {
            if (typeName.StartsWith("NorthwindModel", global::System.StringComparison.Ordinal))
            {
                return this.GetType().Assembly.GetType(string.Concat("NorthwindClient.NorthwindService", typeName.Substring(14)), true);
            }
            return null;
        }
        /// <summary>
        /// Since the namespace configured for this service reference
        /// in Visual Studio is different from the one indicated in the
        /// server schema, use type-mappers to map between the two.
        /// </summary>
        protected string ResolveNameFromType(global::System.Type clientType)
        {
            if (clientType.Namespace.Equals("NorthwindClient.NorthwindService", global::System.StringComparison.Ordinal))
            {
                return string.Concat("NorthwindModel.", clientType.Name);
            }
            return null;
        }
        /// <summary>
        /// There are no comments for Categories in the schema.
        /// </summary>
        public global::System.Data.Services.Client.DataServiceQuery<Categories> Categories
        {
            get
            {
                if ((this._Categories == null))
                {
                    this._Categories = base.CreateQuery<Categories>("Categories");
                }
                return this._Categories;
            }
        }
        private global::System.Data.Services.Client.DataServiceQuery<Categories> _Categories;
        /// <summary>
        /// There are no comments for Products in the schema.
        /// </summary>
        public global::System.Data.Services.Client.DataServiceQuery<Products> Products
        {
            get
            {
                if ((this._Products == null))
                {
                    this._Products = base.CreateQuery<Products>("Products");
                }
                return this._Products;
            }
        }
        private global::System.Data.Services.Client.DataServiceQuery<Products> _Products;
        /// <summary>
        /// There are no comments for Suppliers in the schema.
        /// </summary>
        public global::System.Data.Services.Client.DataServiceQuery<Suppliers> Suppliers
        {
            get
            {
                if ((this._Suppliers == null))
                {
                    this._Suppliers = base.CreateQuery<Suppliers>("Suppliers");
                }
                return this._Suppliers;
            }
        }
        private global::System.Data.Services.Client.DataServiceQuery<Suppliers> _Suppliers;
        /// <summary>
        /// There are no comments for Categories in the schema.
        /// </summary>
        public void AddToCategories(Categories categories)
        {
            base.AddObject("Categories", categories);
        }
        /// <summary>
        /// There are no comments for Products in the schema.
        /// </summary>
        public void AddToProducts(Products products)
        {
            base.AddObject("Products", products);
        }
        /// <summary>
        /// There are no comments for Suppliers in the schema.
        /// </summary>
        public void AddToSuppliers(Suppliers suppliers)
        {
            base.AddObject("Suppliers", suppliers);
        }
    }
    /// <summary>
    /// There are no comments for NorthwindModel.Categories in the schema.
    /// </summary>
    /// <KeyProperties>
    /// CategoryID
    /// </KeyProperties>
    [global::System.Data.Services.Common.DataServiceKeyAttribute("CategoryID")]
    public partial class Categories
    {
        /// <summary>
        /// Create a new Categories object.
        /// </summary>
        /// <param name="categoryID">Initial value of CategoryID.</param>
        /// <param name="categoryName">Initial value of CategoryName.</param>
        public static Categories CreateCategories(int categoryID, string categoryName)
        {
            Categories categories = new Categories();
            categories.CategoryID = categoryID;
            categories.CategoryName = categoryName;
            return categories;
        }
        /// <summary>
        /// There are no comments for Property CategoryID in the schema.
        /// </summary>
        public int CategoryID
        {
            get
            {
                return this._CategoryID;
            }
            set
            {
                this.OnCategoryIDChanging(value);
                this._CategoryID = value;
                this.OnCategoryIDChanged();
            }
        }
        private int _CategoryID;
        partial void OnCategoryIDChanging(int value);
        partial void OnCategoryIDChanged();
        /// <summary>
        /// There are no comments for Property CategoryName in the schema.
        /// </summary>
        public string CategoryName
        {
            get
            {
                return this._CategoryName;
            }
            set
            {
                this.OnCategoryNameChanging(value);
                this._CategoryName = value;
                this.OnCategoryNameChanged();
            }
        }
        private string _CategoryName;
        partial void OnCategoryNameChanging(string value);
        partial void OnCategoryNameChanged();
        /// <summary>
        /// There are no comments for Property Description in the schema.
        /// </summary>
        public string Description
        {
            get
            {
                return this._Description;
            }
            set
            {
                this.OnDescriptionChanging(value);
                this._Description = value;
                this.OnDescriptionChanged();
            }
        }
        private string _Description;
        partial void OnDescriptionChanging(string value);
        partial void OnDescriptionChanged();
        /// <summary>
        /// There are no comments for Property Picture in the schema.
        /// </summary>
        public byte[] Picture
        {
            get
            {
                if ((this._Picture != null))
                {
                    return ((byte[])(this._Picture.Clone()));
                }
                else
                {
                    return null;
                }
            }
            set
            {
                this.OnPictureChanging(value);
                this._Picture = value;
                this.OnPictureChanged();
            }
        }
        private byte[] _Picture;
        partial void OnPictureChanging(byte[] value);
        partial void OnPictureChanged();
        /// <summary>
        /// There are no comments for Products in the schema.
        /// </summary>
        public global::System.Collections.ObjectModel.Collection<Products> Products
        {
            get
            {
                return this._Products;
            }
            set
            {
                if ((value != null))
                {
                    this._Products = value;
                }
            }
        }
        private global::System.Collections.ObjectModel.Collection<Products> _Products = new global::System.Collections.ObjectModel.Collection<Products>();
    }
    /// <summary>
    /// There are no comments for NorthwindModel.Products in the schema.
    /// </summary>
    /// <KeyProperties>
    /// ProductID
    /// </KeyProperties>
    [global::System.Data.Services.Common.DataServiceKeyAttribute("ProductID")]
    public partial class Products
    {
        /// <summary>
        /// Create a new Products object.
        /// </summary>
        /// <param name="productID">Initial value of ProductID.</param>
        /// <param name="productName">Initial value of ProductName.</param>
        /// <param name="discontinued">Initial value of Discontinued.</param>
        public static Products CreateProducts(int productID, string productName, bool discontinued)
        {
            Products products = new Products();
            products.ProductID = productID;
            products.ProductName = productName;
            products.Discontinued = discontinued;
            return products;
        }
        /// <summary>
        /// There are no comments for Property ProductID in the schema.
        /// </summary>
        public int ProductID
        {
            get
            {
                return this._ProductID;
            }
            set
            {
                this.OnProductIDChanging(value);
                this._ProductID = value;
                this.OnProductIDChanged();
            }
        }
        private int _ProductID;
        partial void OnProductIDChanging(int value);
        partial void OnProductIDChanged();
        /// <summary>
        /// There are no comments for Property ProductName in the schema.
        /// </summary>
        public string ProductName
        {
            get
            {
                return this._ProductName;
            }
            set
            {
                this.OnProductNameChanging(value);
                this._ProductName = value;
                this.OnProductNameChanged();
            }
        }
        private string _ProductName;
        partial void OnProductNameChanging(string value);
        partial void OnProductNameChanged();
        /// <summary>
        /// There are no comments for Property QuantityPerUnit in the schema.
        /// </summary>
        public string QuantityPerUnit
        {
            get
            {
                return this._QuantityPerUnit;
            }
            set
            {
                this.OnQuantityPerUnitChanging(value);
                this._QuantityPerUnit = value;
                this.OnQuantityPerUnitChanged();
            }
        }
        private string _QuantityPerUnit;
        partial void OnQuantityPerUnitChanging(string value);
        partial void OnQuantityPerUnitChanged();
        /// <summary>
        /// There are no comments for Property UnitPrice in the schema.
        /// </summary>
        public global::System.Nullable<decimal> UnitPrice
        {
            get
            {
                return this._UnitPrice;
            }
            set
            {
                this.OnUnitPriceChanging(value);
                this._UnitPrice = value;
                this.OnUnitPriceChanged();
            }
        }
        private global::System.Nullable<decimal> _UnitPrice;
        partial void OnUnitPriceChanging(global::System.Nullable<decimal> value);
        partial void OnUnitPriceChanged();
        /// <summary>
        /// There are no comments for Property UnitsInStock in the schema.
        /// </summary>
        public global::System.Nullable<short> UnitsInStock
        {
            get
            {
                return this._UnitsInStock;
            }
            set
            {
                this.OnUnitsInStockChanging(value);
                this._UnitsInStock = value;
                this.OnUnitsInStockChanged();
            }
        }
        private global::System.Nullable<short> _UnitsInStock;
        partial void OnUnitsInStockChanging(global::System.Nullable<short> value);
        partial void OnUnitsInStockChanged();
        /// <summary>
        /// There are no comments for Property UnitsOnOrder in the schema.
        /// </summary>
        public global::System.Nullable<short> UnitsOnOrder
        {
            get
            {
                return this._UnitsOnOrder;
            }
            set
            {
                this.OnUnitsOnOrderChanging(value);
                this._UnitsOnOrder = value;
                this.OnUnitsOnOrderChanged();
            }
        }
        private global::System.Nullable<short> _UnitsOnOrder;
        partial void OnUnitsOnOrderChanging(global::System.Nullable<short> value);
        partial void OnUnitsOnOrderChanged();
        /// <summary>
        /// There are no comments for Property ReorderLevel in the schema.
        /// </summary>
        public global::System.Nullable<short> ReorderLevel
        {
            get
            {
                return this._ReorderLevel;
            }
            set
            {
                this.OnReorderLevelChanging(value);
                this._ReorderLevel = value;
                this.OnReorderLevelChanged();
            }
        }
        private global::System.Nullable<short> _ReorderLevel;
        partial void OnReorderLevelChanging(global::System.Nullable<short> value);
        partial void OnReorderLevelChanged();
        /// <summary>
        /// There are no comments for Property Discontinued in the schema.
        /// </summary>
        public bool Discontinued
        {
            get
            {
                return this._Discontinued;
            }
            set
            {
                this.OnDiscontinuedChanging(value);
                this._Discontinued = value;
                this.OnDiscontinuedChanged();
            }
        }
        private bool _Discontinued;
        partial void OnDiscontinuedChanging(bool value);
        partial void OnDiscontinuedChanged();
        /// <summary>
        /// There are no comments for Categories in the schema.
        /// </summary>
        public Categories Categories
        {
            get
            {
                return this._Categories;
            }
            set
            {
                this._Categories = value;
            }
        }
        private Categories _Categories;
        /// <summary>
        /// There are no comments for Suppliers in the schema.
        /// </summary>
        public Suppliers Suppliers
        {
            get
            {
                return this._Suppliers;
            }
            set
            {
                this._Suppliers = value;
            }
        }
        private Suppliers _Suppliers;
    }
    /// <summary>
    /// There are no comments for NorthwindModel.Suppliers in the schema.
    /// </summary>
    /// <KeyProperties>
    /// SupplierID
    /// </KeyProperties>
    [global::System.Data.Services.Common.DataServiceKeyAttribute("SupplierID")]
    public partial class Suppliers
    {
        /// <summary>
        /// Create a new Suppliers object.
        /// </summary>
        /// <param name="supplierID">Initial value of SupplierID.</param>
        /// <param name="companyName">Initial value of CompanyName.</param>
        public static Suppliers CreateSuppliers(int supplierID, string companyName)
        {
            Suppliers suppliers = new Suppliers();
            suppliers.SupplierID = supplierID;
            suppliers.CompanyName = companyName;
            return suppliers;
        }
        /// <summary>
        /// There are no comments for Property SupplierID in the schema.
        /// </summary>
        public int SupplierID
        {
            get
            {
                return this._SupplierID;
            }
            set
            {
                this.OnSupplierIDChanging(value);
                this._SupplierID = value;
                this.OnSupplierIDChanged();
            }
        }
        private int _SupplierID;
        partial void OnSupplierIDChanging(int value);
        partial void OnSupplierIDChanged();
        /// <summary>
        /// There are no comments for Property CompanyName in the schema.
        /// </summary>
        public string CompanyName
        {
            get
            {
                return this._CompanyName;
            }
            set
            {
                this.OnCompanyNameChanging(value);
                this._CompanyName = value;
                this.OnCompanyNameChanged();
            }
        }
        private string _CompanyName;
        partial void OnCompanyNameChanging(string value);
        partial void OnCompanyNameChanged();
        /// <summary>
        /// There are no comments for Property ContactName in the schema.
        /// </summary>
        public string ContactName
        {
            get
            {
                return this._ContactName;
            }
            set
            {
                this.OnContactNameChanging(value);
                this._ContactName = value;
                this.OnContactNameChanged();
            }
        }
        private string _ContactName;
        partial void OnContactNameChanging(string value);
        partial void OnContactNameChanged();
        /// <summary>
        /// There are no comments for Property ContactTitle in the schema.
        /// </summary>
        public string ContactTitle
        {
            get
            {
                return this._ContactTitle;
            }
            set
            {
                this.OnContactTitleChanging(value);
                this._ContactTitle = value;
                this.OnContactTitleChanged();
            }
        }
        private string _ContactTitle;
        partial void OnContactTitleChanging(string value);
        partial void OnContactTitleChanged();
        /// <summary>
        /// There are no comments for Property Address in the schema.
        /// </summary>
        public string Address
        {
            get
            {
                return this._Address;
            }
            set
            {
                this.OnAddressChanging(value);
                this._Address = value;
                this.OnAddressChanged();
            }
        }
        private string _Address;
        partial void OnAddressChanging(string value);
        partial void OnAddressChanged();
        /// <summary>
        /// There are no comments for Property City in the schema.
        /// </summary>
        public string City
        {
            get
            {
                return this._City;
            }
            set
            {
                this.OnCityChanging(value);
                this._City = value;
                this.OnCityChanged();
            }
        }
        private string _City;
        partial void OnCityChanging(string value);
        partial void OnCityChanged();
        /// <summary>
        /// There are no comments for Property Region in the schema.
        /// </summary>
        public string Region
        {
            get
            {
                return this._Region;
            }
            set
            {
                this.OnRegionChanging(value);
                this._Region = value;
                this.OnRegionChanged();
            }
        }
        private string _Region;
        partial void OnRegionChanging(string value);
        partial void OnRegionChanged();
        /// <summary>
        /// There are no comments for Property PostalCode in the schema.
        /// </summary>
        public string PostalCode
        {
            get
            {
                return this._PostalCode;
            }
            set
            {
                this.OnPostalCodeChanging(value);
                this._PostalCode = value;
                this.OnPostalCodeChanged();
            }
        }
        private string _PostalCode;
        partial void OnPostalCodeChanging(string value);
        partial void OnPostalCodeChanged();
        /// <summary>
        /// There are no comments for Property Country in the schema.
        /// </summary>
        public string Country
        {
            get
            {
                return this._Country;
            }
            set
            {
                this.OnCountryChanging(value);
                this._Country = value;
                this.OnCountryChanged();
            }
        }
        private string _Country;
        partial void OnCountryChanging(string value);
        partial void OnCountryChanged();
        /// <summary>
        /// There are no comments for Property Phone in the schema.
        /// </summary>
        public string Phone
        {
            get
            {
                return this._Phone;
            }
            set
            {
                this.OnPhoneChanging(value);
                this._Phone = value;
                this.OnPhoneChanged();
            }
        }
        private string _Phone;
        partial void OnPhoneChanging(string value);
        partial void OnPhoneChanged();
        /// <summary>
        /// There are no comments for Property Fax in the schema.
        /// </summary>
        public string Fax
        {
            get
            {
                return this._Fax;
            }
            set
            {
                this.OnFaxChanging(value);
                this._Fax = value;
                this.OnFaxChanged();
            }
        }
        private string _Fax;
        partial void OnFaxChanging(string value);
        partial void OnFaxChanged();
        /// <summary>
        /// There are no comments for Property HomePage in the schema.
        /// </summary>
        public string HomePage
        {
            get
            {
                return this._HomePage;
            }
            set
            {
                this.OnHomePageChanging(value);
                this._HomePage = value;
                this.OnHomePageChanged();
            }
        }
        private string _HomePage;
        partial void OnHomePageChanging(string value);
        partial void OnHomePageChanged();
        /// <summary>
        /// There are no comments for Products in the schema.
        /// </summary>
        public global::System.Collections.ObjectModel.Collection<Products> Products
        {
            get
            {
                return this._Products;
            }
            set
            {
                if ((value != null))
                {
                    this._Products = value;
                }
            }
        }
        private global::System.Collections.ObjectModel.Collection<Products> _Products = new global::System.Collections.ObjectModel.Collection<Products>();
    }
}
