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

namespace SilverlightApplication1
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Linq;
    using System.ServiceModel.DomainServices;
    using System.ServiceModel.DomainServices.Client;
    using System.ServiceModel.DomainServices.Client.ApplicationServices;
    
    
    /// <summary>
    /// Context for the RIA application.
    /// </summary>
    /// <remarks>
    /// This context extends the base to make application services and types available
    /// for consumption from code and xaml.
    /// </remarks>
    public sealed partial class WebContext : WebContextBase
    {
        
        #region Extensibility Method Definitions

        /// <summary>
        /// This method is invoked from the constructor once initialization is complete and
        /// can be used for further object setup.
        /// </summary>
        partial void OnCreated();

        #endregion
        
        
        /// <summary>
        /// Initializes a new instance of the WebContext class.
        /// </summary>
        public WebContext()
        {
            this.OnCreated();
        }
        
        /// <summary>
        /// Gets the context that is registered as a lifetime object with the current application.
        /// </summary>
        /// <exception cref="InvalidOperationException"> is thrown if there is no current application,
        /// no contexts have been added, or more than one context has been added.
        /// </exception>
        /// <seealso cref="System.Windows.Application.ApplicationLifetimeObjects"/>
        public new static WebContext Current
        {
            get
            {
                return ((WebContext)(WebContextBase.Current));
            }
        }
    }
}
namespace SilverlightApplication1.Web
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Linq;
    using System.Runtime.Serialization;
    using System.ServiceModel;
    using System.ServiceModel.DomainServices;
    using System.ServiceModel.DomainServices.Client;
    using System.ServiceModel.DomainServices.Client.ApplicationServices;
    using System.ServiceModel.Web;
    
    
    /// <summary>
    /// The domain context corresponding to the 'AdventureWorksDomainService1' domain service.
    /// </summary>
    public sealed partial class AdventureWorksDomainService1 : DomainContext
    {
        
        #region Extensibility Method Definitions

        /// <summary>
        /// This method is invoked from the constructor once initialization is complete and
        /// can be used for further object setup.
        /// </summary>
        partial void OnCreated();

        #endregion
        
        
        /// <summary>
        /// Initializes a new instance of the <see cref="AdventureWorksDomainService1"/> class.
        /// </summary>
        public AdventureWorksDomainService1() : 
                this(new WebDomainClient<IAdventureWorksDomainService1Contract>(new Uri("SilverlightApplication1-Web-AdventureWorksDomainService1.svc", UriKind.Relative)))
        {
        }
        
        /// <summary>
        /// Initializes a new instance of the <see cref="AdventureWorksDomainService1"/> class with the specified service URI.
        /// </summary>
        /// <param name="serviceUri">The AdventureWorksDomainService1 service URI.</param>
        public AdventureWorksDomainService1(Uri serviceUri) : 
                this(new WebDomainClient<IAdventureWorksDomainService1Contract>(serviceUri))
        {
        }
        
        /// <summary>
        /// Initializes a new instance of the <see cref="AdventureWorksDomainService1"/> class with the specified <paramref name="domainClient"/>.
        /// </summary>
        /// <param name="domainClient">The DomainClient instance to use for this domain context.</param>
        public AdventureWorksDomainService1(DomainClient domainClient) : 
                base(domainClient)
        {
            this.OnCreated();
        }
        
        /// <summary>
        /// Gets the set of <see cref="Product"/> entities that have been loaded into this <see cref="AdventureWorksDomainService1"/> instance.
        /// </summary>
        public EntitySet<Product> Products
        {
            get
            {
                return base.EntityContainer.GetEntitySet<Product>();
            }
        }
        
        /// <summary>
        /// Gets the set of <see cref="ProductSubcategory"/> entities that have been loaded into this <see cref="AdventureWorksDomainService1"/> instance.
        /// </summary>
        public EntitySet<ProductSubcategory> ProductSubcategories
        {
            get
            {
                return base.EntityContainer.GetEntitySet<ProductSubcategory>();
            }
        }
        
        /// <summary>
        /// Gets an EntityQuery instance that can be used to load <see cref="Product"/> entities using the 'GetProducts' query.
        /// </summary>
        /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Product"/> entities.</returns>
        public EntityQuery<Product> GetProductsQuery()
        {
            this.ValidateMethod("GetProductsQuery", null);
            return base.CreateQuery<Product>("GetProducts", null, false, true);
        }
        
        /// <summary>
        /// Gets an EntityQuery instance that can be used to load <see cref="ProductSubcategory"/> entities using the 'GetProductSubcategories' query.
        /// </summary>
        /// <returns>An EntityQuery that can be loaded to retrieve <see cref="ProductSubcategory"/> entities.</returns>
        public EntityQuery<ProductSubcategory> GetProductSubcategoriesQuery()
        {
            this.ValidateMethod("GetProductSubcategoriesQuery", null);
            return base.CreateQuery<ProductSubcategory>("GetProductSubcategories", null, false, true);
        }
        
        /// <summary>
        /// Creates a new entity container for this domain context's entity sets.
        /// </summary>
        /// <returns>A new container instance.</returns>
        protected override EntityContainer CreateEntityContainer()
        {
            return new AdventureWorksDomainService1EntityContainer();
        }
        
        /// <summary>
        /// Service contract for the 'AdventureWorksDomainService1' domain service.
        /// </summary>
        [ServiceContract()]
        public interface IAdventureWorksDomainService1Contract
        {
            
            /// <summary>
            /// Asynchronously invokes the 'GetProducts' operation.
            /// </summary>
            /// <param name="callback">Callback to invoke on completion.</param>
            /// <param name="asyncState">Optional state object.</param>
            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AdventureWorksDomainService1/GetProductsDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AdventureWorksDomainService1/GetProducts", ReplyAction="http://tempuri.org/AdventureWorksDomainService1/GetProductsResponse")]
            [WebGet()]
            IAsyncResult BeginGetProducts(AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginGetProducts'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginGetProducts'.</param>
            /// <returns>The 'QueryResult' returned from the 'GetProducts' operation.</returns>
            QueryResult<Product> EndGetProducts(IAsyncResult result);
            
            /// <summary>
            /// Asynchronously invokes the 'GetProductSubcategories' operation.
            /// </summary>
            /// <param name="callback">Callback to invoke on completion.</param>
            /// <param name="asyncState">Optional state object.</param>
            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AdventureWorksDomainService1/GetProductSubcategoriesDomainServ" +
                "iceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AdventureWorksDomainService1/GetProductSubcategories", ReplyAction="http://tempuri.org/AdventureWorksDomainService1/GetProductSubcategoriesResponse")]
            [WebGet()]
            IAsyncResult BeginGetProductSubcategories(AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginGetProductSubcategories'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginGetProductSubcategories'.</param>
            /// <returns>The 'QueryResult' returned from the 'GetProductSubcategories' operation.</returns>
            QueryResult<ProductSubcategory> EndGetProductSubcategories(IAsyncResult result);
            
            /// <summary>
            /// Asynchronously invokes the 'SubmitChanges' operation.
            /// </summary>
            /// <param name="changeSet">The change-set to submit.</param>
            /// <param name="callback">Callback to invoke on completion.</param>
            /// <param name="asyncState">Optional state object.</param>
            /// <returns>An IAsyncResult that can be used to monitor the request.</returns>
            [FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AdventureWorksDomainService1/SubmitChangesDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AdventureWorksDomainService1/SubmitChanges", ReplyAction="http://tempuri.org/AdventureWorksDomainService1/SubmitChangesResponse")]
            IAsyncResult BeginSubmitChanges(IEnumerable<ChangeSetEntry> changeSet, AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginSubmitChanges'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginSubmitChanges'.</param>
            /// <returns>The collection of change-set entry elements returned from 'SubmitChanges'.</returns>
            IEnumerable<ChangeSetEntry> EndSubmitChanges(IAsyncResult result);
        }
        
        internal sealed class AdventureWorksDomainService1EntityContainer : EntityContainer
        {
            
            public AdventureWorksDomainService1EntityContainer()
            {
                this.CreateEntitySet<Product>(EntitySetOperations.None);
                this.CreateEntitySet<ProductSubcategory>(EntitySetOperations.None);
            }
        }
    }
    
    /// <summary>
    /// The 'Product' entity class.
    /// </summary>
    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/SilverlightApplication1.Web")]
    public sealed partial class Product : Entity
    {
        
        private string _class;
        
        private string _color;
        
        private int _daysToManufacture;
        
        private Nullable<DateTime> _discontinuedDate;
        
        private bool _finishedGoodsFlag;
        
        private decimal _listPrice;
        
        private bool _makeFlag;
        
        private DateTime _modifiedDate;
        
        private string _name;
        
        private int _productID;
        
        private string _productLine;
        
        private Nullable<int> _productModelID;
        
        private string _productNumber;
        
        private Nullable<int> _productSubcategoryID;
        
        private short _reorderPoint;
        
        private Guid _rowguid;
        
        private short _safetyStockLevel;
        
        private Nullable<DateTime> _sellEndDate;
        
        private DateTime _sellStartDate;
        
        private string _size;
        
        private string _sizeUnitMeasureCode;
        
        private decimal _standardCost;
        
        private string _style;
        
        private Nullable<decimal> _weight;
        
        private string _weightUnitMeasureCode;
        
        #region Extensibility Method Definitions

        /// <summary>
        /// This method is invoked from the constructor once initialization is complete and
        /// can be used for further object setup.
        /// </summary>
        partial void OnCreated();
        partial void OnClassChanging(string value);
        partial void OnClassChanged();
        partial void OnColorChanging(string value);
        partial void OnColorChanged();
        partial void OnDaysToManufactureChanging(int value);
        partial void OnDaysToManufactureChanged();
        partial void OnDiscontinuedDateChanging(Nullable<DateTime> value);
        partial void OnDiscontinuedDateChanged();
        partial void OnFinishedGoodsFlagChanging(bool value);
        partial void OnFinishedGoodsFlagChanged();
        partial void OnListPriceChanging(decimal value);
        partial void OnListPriceChanged();
        partial void OnMakeFlagChanging(bool value);
        partial void OnMakeFlagChanged();
        partial void OnModifiedDateChanging(DateTime value);
        partial void OnModifiedDateChanged();
        partial void OnNameChanging(string value);
        partial void OnNameChanged();
        partial void OnProductIDChanging(int value);
        partial void OnProductIDChanged();
        partial void OnProductLineChanging(string value);
        partial void OnProductLineChanged();
        partial void OnProductModelIDChanging(Nullable<int> value);
        partial void OnProductModelIDChanged();
        partial void OnProductNumberChanging(string value);
        partial void OnProductNumberChanged();
        partial void OnProductSubcategoryIDChanging(Nullable<int> value);
        partial void OnProductSubcategoryIDChanged();
        partial void OnReorderPointChanging(short value);
        partial void OnReorderPointChanged();
        partial void OnrowguidChanging(Guid value);
        partial void OnrowguidChanged();
        partial void OnSafetyStockLevelChanging(short value);
        partial void OnSafetyStockLevelChanged();
        partial void OnSellEndDateChanging(Nullable<DateTime> value);
        partial void OnSellEndDateChanged();
        partial void OnSellStartDateChanging(DateTime value);
        partial void OnSellStartDateChanged();
        partial void OnSizeChanging(string value);
        partial void OnSizeChanged();
        partial void OnSizeUnitMeasureCodeChanging(string value);
        partial void OnSizeUnitMeasureCodeChanged();
        partial void OnStandardCostChanging(decimal value);
        partial void OnStandardCostChanged();
        partial void OnStyleChanging(string value);
        partial void OnStyleChanged();
        partial void OnWeightChanging(Nullable<decimal> value);
        partial void OnWeightChanged();
        partial void OnWeightUnitMeasureCodeChanging(string value);
        partial void OnWeightUnitMeasureCodeChanged();

        #endregion
        
        
        /// <summary>
        /// Initializes a new instance of the <see cref="Product"/> class.
        /// </summary>
        public Product()
        {
            this.OnCreated();
        }
        
        /// <summary>
        /// Gets or sets the 'Class' value.
        /// </summary>
        [DataMember()]
        [StringLength(2)]
        public string Class
        {
            get
            {
                return this._class;
            }
            set
            {
                if ((this._class != value))
                {
                    this.OnClassChanging(value);
                    this.RaiseDataMemberChanging("Class");
                    this.ValidateProperty("Class", value);
                    this._class = value;
                    this.RaiseDataMemberChanged("Class");
                    this.OnClassChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'Color' value.
        /// </summary>
        [DataMember()]
        [StringLength(15)]
        public string Color
        {
            get
            {
                return this._color;
            }
            set
            {
                if ((this._color != value))
                {
                    this.OnColorChanging(value);
                    this.RaiseDataMemberChanging("Color");
                    this.ValidateProperty("Color", value);
                    this._color = value;
                    this.RaiseDataMemberChanged("Color");
                    this.OnColorChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'DaysToManufacture' value.
        /// </summary>
        [DataMember()]
        public int DaysToManufacture
        {
            get
            {
                return this._daysToManufacture;
            }
            set
            {
                if ((this._daysToManufacture != value))
                {
                    this.OnDaysToManufactureChanging(value);
                    this.RaiseDataMemberChanging("DaysToManufacture");
                    this.ValidateProperty("DaysToManufacture", value);
                    this._daysToManufacture = value;
                    this.RaiseDataMemberChanged("DaysToManufacture");
                    this.OnDaysToManufactureChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'DiscontinuedDate' value.
        /// </summary>
        [DataMember()]
        public Nullable<DateTime> DiscontinuedDate
        {
            get
            {
                return this._discontinuedDate;
            }
            set
            {
                if ((this._discontinuedDate != value))
                {
                    this.OnDiscontinuedDateChanging(value);
                    this.RaiseDataMemberChanging("DiscontinuedDate");
                    this.ValidateProperty("DiscontinuedDate", value);
                    this._discontinuedDate = value;
                    this.RaiseDataMemberChanged("DiscontinuedDate");
                    this.OnDiscontinuedDateChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'FinishedGoodsFlag' value.
        /// </summary>
        [DataMember()]
        public bool FinishedGoodsFlag
        {
            get
            {
                return this._finishedGoodsFlag;
            }
            set
            {
                if ((this._finishedGoodsFlag != value))
                {
                    this.OnFinishedGoodsFlagChanging(value);
                    this.RaiseDataMemberChanging("FinishedGoodsFlag");
                    this.ValidateProperty("FinishedGoodsFlag", value);
                    this._finishedGoodsFlag = value;
                    this.RaiseDataMemberChanged("FinishedGoodsFlag");
                    this.OnFinishedGoodsFlagChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ListPrice' value.
        /// </summary>
        [DataMember()]
        public decimal ListPrice
        {
            get
            {
                return this._listPrice;
            }
            set
            {
                if ((this._listPrice != value))
                {
                    this.OnListPriceChanging(value);
                    this.RaiseDataMemberChanging("ListPrice");
                    this.ValidateProperty("ListPrice", value);
                    this._listPrice = value;
                    this.RaiseDataMemberChanged("ListPrice");
                    this.OnListPriceChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'MakeFlag' value.
        /// </summary>
        [DataMember()]
        public bool MakeFlag
        {
            get
            {
                return this._makeFlag;
            }
            set
            {
                if ((this._makeFlag != value))
                {
                    this.OnMakeFlagChanging(value);
                    this.RaiseDataMemberChanging("MakeFlag");
                    this.ValidateProperty("MakeFlag", value);
                    this._makeFlag = value;
                    this.RaiseDataMemberChanged("MakeFlag");
                    this.OnMakeFlagChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ModifiedDate' value.
        /// </summary>
        [DataMember()]
        public DateTime ModifiedDate
        {
            get
            {
                return this._modifiedDate;
            }
            set
            {
                if ((this._modifiedDate != value))
                {
                    this.OnModifiedDateChanging(value);
                    this.RaiseDataMemberChanging("ModifiedDate");
                    this.ValidateProperty("ModifiedDate", value);
                    this._modifiedDate = value;
                    this.RaiseDataMemberChanged("ModifiedDate");
                    this.OnModifiedDateChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'Name' value.
        /// </summary>
        [DataMember()]
        [Required()]
        [StringLength(50)]
        public string Name
        {
            get
            {
                return this._name;
            }
            set
            {
                if ((this._name != value))
                {
                    this.OnNameChanging(value);
                    this.RaiseDataMemberChanging("Name");
                    this.ValidateProperty("Name", value);
                    this._name = value;
                    this.RaiseDataMemberChanged("Name");
                    this.OnNameChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ProductID' value.
        /// </summary>
        [DataMember()]
        [Editable(false, AllowInitialValue=true)]
        [Key()]
        [RoundtripOriginal()]
        public int ProductID
        {
            get
            {
                return this._productID;
            }
            set
            {
                if ((this._productID != value))
                {
                    this.OnProductIDChanging(value);
                    this.ValidateProperty("ProductID", value);
                    this._productID = value;
                    this.RaisePropertyChanged("ProductID");
                    this.OnProductIDChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ProductLine' value.
        /// </summary>
        [DataMember()]
        [StringLength(2)]
        public string ProductLine
        {
            get
            {
                return this._productLine;
            }
            set
            {
                if ((this._productLine != value))
                {
                    this.OnProductLineChanging(value);
                    this.RaiseDataMemberChanging("ProductLine");
                    this.ValidateProperty("ProductLine", value);
                    this._productLine = value;
                    this.RaiseDataMemberChanged("ProductLine");
                    this.OnProductLineChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ProductModelID' value.
        /// </summary>
        [DataMember()]
        public Nullable<int> ProductModelID
        {
            get
            {
                return this._productModelID;
            }
            set
            {
                if ((this._productModelID != value))
                {
                    this.OnProductModelIDChanging(value);
                    this.RaiseDataMemberChanging("ProductModelID");
                    this.ValidateProperty("ProductModelID", value);
                    this._productModelID = value;
                    this.RaiseDataMemberChanged("ProductModelID");
                    this.OnProductModelIDChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ProductNumber' value.
        /// </summary>
        [DataMember()]
        [Required()]
        [StringLength(25)]
        public string ProductNumber
        {
            get
            {
                return this._productNumber;
            }
            set
            {
                if ((this._productNumber != value))
                {
                    this.OnProductNumberChanging(value);
                    this.RaiseDataMemberChanging("ProductNumber");
                    this.ValidateProperty("ProductNumber", value);
                    this._productNumber = value;
                    this.RaiseDataMemberChanged("ProductNumber");
                    this.OnProductNumberChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ProductSubcategoryID' value.
        /// </summary>
        [DataMember()]
        public Nullable<int> ProductSubcategoryID
        {
            get
            {
                return this._productSubcategoryID;
            }
            set
            {
                if ((this._productSubcategoryID != value))
                {
                    this.OnProductSubcategoryIDChanging(value);
                    this.RaiseDataMemberChanging("ProductSubcategoryID");
                    this.ValidateProperty("ProductSubcategoryID", value);
                    this._productSubcategoryID = value;
                    this.RaiseDataMemberChanged("ProductSubcategoryID");
                    this.OnProductSubcategoryIDChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ReorderPoint' value.
        /// </summary>
        [DataMember()]
        public short ReorderPoint
        {
            get
            {
                return this._reorderPoint;
            }
            set
            {
                if ((this._reorderPoint != value))
                {
                    this.OnReorderPointChanging(value);
                    this.RaiseDataMemberChanging("ReorderPoint");
                    this.ValidateProperty("ReorderPoint", value);
                    this._reorderPoint = value;
                    this.RaiseDataMemberChanged("ReorderPoint");
                    this.OnReorderPointChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'rowguid' value.
        /// </summary>
        [DataMember()]
        public Guid rowguid
        {
            get
            {
                return this._rowguid;
            }
            set
            {
                if ((this._rowguid != value))
                {
                    this.OnrowguidChanging(value);
                    this.RaiseDataMemberChanging("rowguid");
                    this.ValidateProperty("rowguid", value);
                    this._rowguid = value;
                    this.RaiseDataMemberChanged("rowguid");
                    this.OnrowguidChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'SafetyStockLevel' value.
        /// </summary>
        [DataMember()]
        public short SafetyStockLevel
        {
            get
            {
                return this._safetyStockLevel;
            }
            set
            {
                if ((this._safetyStockLevel != value))
                {
                    this.OnSafetyStockLevelChanging(value);
                    this.RaiseDataMemberChanging("SafetyStockLevel");
                    this.ValidateProperty("SafetyStockLevel", value);
                    this._safetyStockLevel = value;
                    this.RaiseDataMemberChanged("SafetyStockLevel");
                    this.OnSafetyStockLevelChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'SellEndDate' value.
        /// </summary>
        [DataMember()]
        public Nullable<DateTime> SellEndDate
        {
            get
            {
                return this._sellEndDate;
            }
            set
            {
                if ((this._sellEndDate != value))
                {
                    this.OnSellEndDateChanging(value);
                    this.RaiseDataMemberChanging("SellEndDate");
                    this.ValidateProperty("SellEndDate", value);
                    this._sellEndDate = value;
                    this.RaiseDataMemberChanged("SellEndDate");
                    this.OnSellEndDateChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'SellStartDate' value.
        /// </summary>
        [DataMember()]
        public DateTime SellStartDate
        {
            get
            {
                return this._sellStartDate;
            }
            set
            {
                if ((this._sellStartDate != value))
                {
                    this.OnSellStartDateChanging(value);
                    this.RaiseDataMemberChanging("SellStartDate");
                    this.ValidateProperty("SellStartDate", value);
                    this._sellStartDate = value;
                    this.RaiseDataMemberChanged("SellStartDate");
                    this.OnSellStartDateChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'Size' value.
        /// </summary>
        [DataMember()]
        [StringLength(5)]
        public string Size
        {
            get
            {
                return this._size;
            }
            set
            {
                if ((this._size != value))
                {
                    this.OnSizeChanging(value);
                    this.RaiseDataMemberChanging("Size");
                    this.ValidateProperty("Size", value);
                    this._size = value;
                    this.RaiseDataMemberChanged("Size");
                    this.OnSizeChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'SizeUnitMeasureCode' value.
        /// </summary>
        [DataMember()]
        [StringLength(3)]
        public string SizeUnitMeasureCode
        {
            get
            {
                return this._sizeUnitMeasureCode;
            }
            set
            {
                if ((this._sizeUnitMeasureCode != value))
                {
                    this.OnSizeUnitMeasureCodeChanging(value);
                    this.RaiseDataMemberChanging("SizeUnitMeasureCode");
                    this.ValidateProperty("SizeUnitMeasureCode", value);
                    this._sizeUnitMeasureCode = value;
                    this.RaiseDataMemberChanged("SizeUnitMeasureCode");
                    this.OnSizeUnitMeasureCodeChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'StandardCost' value.
        /// </summary>
        [DataMember()]
        public decimal StandardCost
        {
            get
            {
                return this._standardCost;
            }
            set
            {
                if ((this._standardCost != value))
                {
                    this.OnStandardCostChanging(value);
                    this.RaiseDataMemberChanging("StandardCost");
                    this.ValidateProperty("StandardCost", value);
                    this._standardCost = value;
                    this.RaiseDataMemberChanged("StandardCost");
                    this.OnStandardCostChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'Style' value.
        /// </summary>
        [DataMember()]
        [StringLength(2)]
        public string Style
        {
            get
            {
                return this._style;
            }
            set
            {
                if ((this._style != value))
                {
                    this.OnStyleChanging(value);
                    this.RaiseDataMemberChanging("Style");
                    this.ValidateProperty("Style", value);
                    this._style = value;
                    this.RaiseDataMemberChanged("Style");
                    this.OnStyleChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'Weight' value.
        /// </summary>
        [DataMember()]
        public Nullable<decimal> Weight
        {
            get
            {
                return this._weight;
            }
            set
            {
                if ((this._weight != value))
                {
                    this.OnWeightChanging(value);
                    this.RaiseDataMemberChanging("Weight");
                    this.ValidateProperty("Weight", value);
                    this._weight = value;
                    this.RaiseDataMemberChanged("Weight");
                    this.OnWeightChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'WeightUnitMeasureCode' value.
        /// </summary>
        [DataMember()]
        [StringLength(3)]
        public string WeightUnitMeasureCode
        {
            get
            {
                return this._weightUnitMeasureCode;
            }
            set
            {
                if ((this._weightUnitMeasureCode != value))
                {
                    this.OnWeightUnitMeasureCodeChanging(value);
                    this.RaiseDataMemberChanging("WeightUnitMeasureCode");
                    this.ValidateProperty("WeightUnitMeasureCode", value);
                    this._weightUnitMeasureCode = value;
                    this.RaiseDataMemberChanged("WeightUnitMeasureCode");
                    this.OnWeightUnitMeasureCodeChanged();
                }
            }
        }
        
        /// <summary>
        /// Computes a value from the key fields that uniquely identifies this entity instance.
        /// </summary>
        /// <returns>An object instance that uniquely identifies this entity instance.</returns>
        public override object GetIdentity()
        {
            return this._productID;
        }
    }
    
    /// <summary>
    /// The 'ProductSubcategory' entity class.
    /// </summary>
    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/SilverlightApplication1.Web")]
    public sealed partial class ProductSubcategory : Entity
    {
        
        private DateTime _modifiedDate;
        
        private string _name;
        
        private int _productCategoryID;
        
        private int _productSubcategoryID;
        
        private Guid _rowguid;
        
        #region Extensibility Method Definitions

        /// <summary>
        /// This method is invoked from the constructor once initialization is complete and
        /// can be used for further object setup.
        /// </summary>
        partial void OnCreated();
        partial void OnModifiedDateChanging(DateTime value);
        partial void OnModifiedDateChanged();
        partial void OnNameChanging(string value);
        partial void OnNameChanged();
        partial void OnProductCategoryIDChanging(int value);
        partial void OnProductCategoryIDChanged();
        partial void OnProductSubcategoryIDChanging(int value);
        partial void OnProductSubcategoryIDChanged();
        partial void OnrowguidChanging(Guid value);
        partial void OnrowguidChanged();

        #endregion
        
        
        /// <summary>
        /// Initializes a new instance of the <see cref="ProductSubcategory"/> class.
        /// </summary>
        public ProductSubcategory()
        {
            this.OnCreated();
        }
        
        /// <summary>
        /// Gets or sets the 'ModifiedDate' value.
        /// </summary>
        [DataMember()]
        public DateTime ModifiedDate
        {
            get
            {
                return this._modifiedDate;
            }
            set
            {
                if ((this._modifiedDate != value))
                {
                    this.OnModifiedDateChanging(value);
                    this.RaiseDataMemberChanging("ModifiedDate");
                    this.ValidateProperty("ModifiedDate", value);
                    this._modifiedDate = value;
                    this.RaiseDataMemberChanged("ModifiedDate");
                    this.OnModifiedDateChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'Name' value.
        /// </summary>
        [DataMember()]
        [Required()]
        [StringLength(50)]
        public string Name
        {
            get
            {
                return this._name;
            }
            set
            {
                if ((this._name != value))
                {
                    this.OnNameChanging(value);
                    this.RaiseDataMemberChanging("Name");
                    this.ValidateProperty("Name", value);
                    this._name = value;
                    this.RaiseDataMemberChanged("Name");
                    this.OnNameChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ProductCategoryID' value.
        /// </summary>
        [DataMember()]
        public int ProductCategoryID
        {
            get
            {
                return this._productCategoryID;
            }
            set
            {
                if ((this._productCategoryID != value))
                {
                    this.OnProductCategoryIDChanging(value);
                    this.RaiseDataMemberChanging("ProductCategoryID");
                    this.ValidateProperty("ProductCategoryID", value);
                    this._productCategoryID = value;
                    this.RaiseDataMemberChanged("ProductCategoryID");
                    this.OnProductCategoryIDChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'ProductSubcategoryID' value.
        /// </summary>
        [DataMember()]
        [Editable(false, AllowInitialValue=true)]
        [Key()]
        [RoundtripOriginal()]
        public int ProductSubcategoryID
        {
            get
            {
                return this._productSubcategoryID;
            }
            set
            {
                if ((this._productSubcategoryID != value))
                {
                    this.OnProductSubcategoryIDChanging(value);
                    this.ValidateProperty("ProductSubcategoryID", value);
                    this._productSubcategoryID = value;
                    this.RaisePropertyChanged("ProductSubcategoryID");
                    this.OnProductSubcategoryIDChanged();
                }
            }
        }
        
        /// <summary>
        /// Gets or sets the 'rowguid' value.
        /// </summary>
        [DataMember()]
        public Guid rowguid
        {
            get
            {
                return this._rowguid;
            }
            set
            {
                if ((this._rowguid != value))
                {
                    this.OnrowguidChanging(value);
                    this.RaiseDataMemberChanging("rowguid");
                    this.ValidateProperty("rowguid", value);
                    this._rowguid = value;
                    this.RaiseDataMemberChanged("rowguid");
                    this.OnrowguidChanged();
                }
            }
        }
        
        /// <summary>
        /// Computes a value from the key fields that uniquely identifies this entity instance.
        /// </summary>
        /// <returns>An object instance that uniquely identifies this entity instance.</returns>
        public override object GetIdentity()
        {
            return this._productSubcategoryID;
        }
    }
}
