//------------------------------------------------------------------------------
// <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: 10/9/2008 4:18:46 PM
namespace NorthwindBackend.NorthwindServiceReference
{
    
    /// <summary>
    /// There are no comments for Northwind_Entities in the schema.
    /// </summary>
    public partial class Northwind_Entities : global::System.Data.Services.Client.DataServiceContext
    {
        /// <summary>
        /// Initialize a new Northwind_Entities object.
        /// </summary>
        public Northwind_Entities(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("NorthwindBackend.NorthwindServiceReference", 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("NorthwindBackend.NorthwindServiceReference", global::System.StringComparison.Ordinal))
            {
                return string.Concat("NorthwindModel.", clientType.Name);
            }
            return null;
        }
        /// <summary>
        /// There are no comments for CategorySet in the schema.
        /// </summary>
        public global::System.Data.Services.Client.DataServiceQuery<Category> CategorySet
        {
            get
            {
                if ((this._CategorySet == null))
                {
                    this._CategorySet = base.CreateQuery<Category>("CategorySet");
                }
                return this._CategorySet;
            }
        }
        private global::System.Data.Services.Client.DataServiceQuery<Category> _CategorySet;
        /// <summary>
        /// There are no comments for ProductSet in the schema.
        /// </summary>
        public global::System.Data.Services.Client.DataServiceQuery<Product> ProductSet
        {
            get
            {
                if ((this._ProductSet == null))
                {
                    this._ProductSet = base.CreateQuery<Product>("ProductSet");
                }
                return this._ProductSet;
            }
        }
        private global::System.Data.Services.Client.DataServiceQuery<Product> _ProductSet;
        /// <summary>
        /// There are no comments for SupplierSet in the schema.
        /// </summary>
        public global::System.Data.Services.Client.DataServiceQuery<Supplier> SupplierSet
        {
            get
            {
                if ((this._SupplierSet == null))
                {
                    this._SupplierSet = base.CreateQuery<Supplier>("SupplierSet");
                }
                return this._SupplierSet;
            }
        }
        private global::System.Data.Services.Client.DataServiceQuery<Supplier> _SupplierSet;
        /// <summary>
        /// There are no comments for CategorySet in the schema.
        /// </summary>
        public void AddToCategorySet(Category category)
        {
            base.AddObject("CategorySet", category);
        }
        /// <summary>
        /// There are no comments for ProductSet in the schema.
        /// </summary>
        public void AddToProductSet(Product product)
        {
            base.AddObject("ProductSet", product);
        }
        /// <summary>
        /// There are no comments for SupplierSet in the schema.
        /// </summary>
        public void AddToSupplierSet(Supplier supplier)
        {
            base.AddObject("SupplierSet", supplier);
        }
    }
    /// <summary>
    /// There are no comments for NorthwindModel.Category in the schema.
    /// </summary>
    /// <KeyProperties>
    /// CategoryID
    /// </KeyProperties>
    [global::System.Data.Services.Common.DataServiceKeyAttribute("CategoryID")]
    public partial class Category
    {
        /// <summary>
        /// Create a new Category object.
        /// </summary>
        /// <param name="categoryID">Initial value of CategoryID.</param>
        /// <param name="categoryName">Initial value of CategoryName.</param>
        public static Category CreateCategory(int categoryID, string categoryName)
        {
            Category category = new Category();
            category.CategoryID = categoryID;
            category.CategoryName = categoryName;
            return category;
        }
        /// <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.ObservableCollection<Product> Products
        {
            get
            {
                return this._Products;
            }
            set
            {
                if ((value != null))
                {
                    this._Products = value;
                }
            }
        }
        private global::System.Collections.ObjectModel.ObservableCollection<Product> _Products = new global::System.Collections.ObjectModel.ObservableCollection<Product>();
    }
    /// <summary>
    /// There are no comments for NorthwindModel.Product in the schema.
    /// </summary>
    /// <KeyProperties>
    /// ProductID
    /// </KeyProperties>
    [global::System.Data.Services.Common.DataServiceKeyAttribute("ProductID")]
    public partial class Product
    {
        /// <summary>
        /// Create a new Product object.
        /// </summary>
        /// <param name="discontinued">Initial value of Discontinued.</param>
        /// <param name="productID">Initial value of ProductID.</param>
        /// <param name="productName">Initial value of ProductName.</param>
        public static Product CreateProduct(bool discontinued, int productID, string productName)
        {
            Product product = new Product();
            product.Discontinued = discontinued;
            product.ProductID = productID;
            product.ProductName = productName;
            return product;
        }
        /// <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 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 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 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 Category in the schema.
        /// </summary>
        public Category Category
        {
            get
            {
                return this._Category;
            }
            set
            {
                this._Category = value;
            }
        }
        private Category _Category;
        /// <summary>
        /// There are no comments for Supplier in the schema.
        /// </summary>
		public Supplier Supplier
		{
			get
			{
				return this._Supplier;
			}
			set
			{
				this.OnSupplierChanging(value);
				this._Supplier = value;
				this.OnSupplierChanged();
			}
		}
		private Supplier _Supplier;
		partial void OnSupplierChanging(Supplier value);
		partial void OnSupplierChanged();
	}
    /// <summary>
    /// There are no comments for NorthwindModel.Supplier in the schema.
    /// </summary>
    /// <KeyProperties>
    /// SupplierID
    /// </KeyProperties>
    [global::System.Data.Services.Common.DataServiceKeyAttribute("SupplierID")]
    public partial class Supplier
    {
        /// <summary>
        /// Create a new Supplier object.
        /// </summary>
        /// <param name="companyName">Initial value of CompanyName.</param>
        /// <param name="supplierID">Initial value of SupplierID.</param>
        public static Supplier CreateSupplier(string companyName, int supplierID)
        {
            Supplier supplier = new Supplier();
            supplier.CompanyName = companyName;
            supplier.SupplierID = supplierID;
            return supplier;
        }
        /// <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 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 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 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 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 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 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 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 Products in the schema.
        /// </summary>
        public global::System.Collections.ObjectModel.ObservableCollection<Product> Products
        {
            get
            {
                return this._Products;
            }
            set
            {
                if ((value != null))
                {
                    this._Products = value;
                }
            }
        }
        private global::System.Collections.ObjectModel.ObservableCollection<Product> _Products = new global::System.Collections.ObjectModel.ObservableCollection<Product>();
    }
}
