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

namespace RIAPoweredSilverlightApplication
{
    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 RIAPoweredSilverlightApplication.Web.Model
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Linq;
    using System.Runtime.Serialization;
    using System.ServiceModel.DomainServices;
    using System.ServiceModel.DomainServices.Client;
    using System.ServiceModel.DomainServices.Client.ApplicationServices;
    
    
    /// <summary>
    /// The 'Product' entity class.
    /// </summary>
    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/RIAPoweredSilverlightApplication.Web.Mode" +
        "l")]
    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 'ProductCategory' entity class.
    /// </summary>
    [DataContract(Namespace="http://schemas.datacontract.org/2004/07/RIAPoweredSilverlightApplication.Web.Mode" +
        "l")]
    public sealed partial class ProductCategory : Entity
    {
        
        private DateTime _modifiedDate;
        
        private string _name;
        
        private int _productCategoryID;
        
        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 OnrowguidChanging(Guid value);
        partial void OnrowguidChanged();

        #endregion
        
        
        /// <summary>
        /// Initializes a new instance of the <see cref="ProductCategory"/> class.
        /// </summary>
        public ProductCategory()
        {
            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>
        // The following attributes were not generated:
        // 
        // - The attribute 'System.ComponentModel.DataAnnotations.CustomValidationAttribute' references type 'RIAPoweredSilverlightApplication.Web.Validation.ProductCategoryValidator' that is not accessible in the client project 'RIAPoweredSilverlightApplication'. If you would like the attribute to be generated, make sure the assembly containing the attribute is referenced on the client.
        // - The attribute 'System.ComponentModel.DataAnnotations.CustomValidationAttribute' references a method 'ProductCategoryNameValid' on type 'RIAPoweredSilverlightApplication.Web.Validation.ProductCategoryValidator' that is not accessible in the client project 'RIAPoweredSilverlightApplication'.
        // [CustomValidationAttribute(typeof(RIAPoweredSilverlightApplication.Web.Validation.ProductCategoryValidator), "ProductCategoryNameValid")]
        // 
        [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()]
        [Editable(false, AllowInitialValue=true)]
        [Key()]
        [RoundtripOriginal()]
        public int ProductCategoryID
        {
            get
            {
                return this._productCategoryID;
            }
            set
            {
                if ((this._productCategoryID != value))
                {
                    this.OnProductCategoryIDChanging(value);
                    this.ValidateProperty("ProductCategoryID", value);
                    this._productCategoryID = value;
                    this.RaisePropertyChanged("ProductCategoryID");
                    this.OnProductCategoryIDChanged();
                }
            }
        }
        
        /// <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._productCategoryID;
        }
    }
}
namespace RIAPoweredSilverlightApplication.Web.Services
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Linq;
    using System.ServiceModel;
    using System.ServiceModel.DomainServices;
    using System.ServiceModel.DomainServices.Client;
    using System.ServiceModel.DomainServices.Client.ApplicationServices;
    using System.ServiceModel.Web;
    using RIAPoweredSilverlightApplication.Web.Model;
    
    
    /// <summary>
    /// The DomainContext corresponding to the 'AdventureWorksDomainService' DomainService.
    /// </summary>
    public sealed partial class AdventureWorksDomainContext : 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="AdventureWorksDomainContext"/> class.
        /// </summary>
        public AdventureWorksDomainContext() : 
                this(new WebDomainClient<IAdventureWorksDomainServiceContract>(new Uri("RIAPoweredSilverlightApplication-Web-Services-AdventureWorksDomainService.svc", UriKind.Relative)))
        {
        }
        
        /// <summary>
        /// Initializes a new instance of the <see cref="AdventureWorksDomainContext"/> class with the specified service URI.
        /// </summary>
        /// <param name="serviceUri">The AdventureWorksDomainService service URI.</param>
        public AdventureWorksDomainContext(Uri serviceUri) : 
                this(new WebDomainClient<IAdventureWorksDomainServiceContract>(serviceUri))
        {
        }
        
        /// <summary>
        /// Initializes a new instance of the <see cref="AdventureWorksDomainContext"/> class with the specified <paramref name="domainClient"/>.
        /// </summary>
        /// <param name="domainClient">The DomainClient instance to use for this DomainContext.</param>
        public AdventureWorksDomainContext(DomainClient domainClient) : 
                base(domainClient)
        {
            this.OnCreated();
        }
        
        /// <summary>
        /// Gets the set of <see cref="Product"/> entity instances that have been loaded into this <see cref="AdventureWorksDomainContext"/> instance.
        /// </summary>
        public EntitySet<Product> Products
        {
            get
            {
                return base.EntityContainer.GetEntitySet<Product>();
            }
        }
        
        /// <summary>
        /// Gets the set of <see cref="ProductCategory"/> entity instances that have been loaded into this <see cref="AdventureWorksDomainContext"/> instance.
        /// </summary>
        public EntitySet<ProductCategory> ProductCategories
        {
            get
            {
                return base.EntityContainer.GetEntitySet<ProductCategory>();
            }
        }
        
        /// <summary>
        /// Gets an EntityQuery instance that can be used to load <see cref="Product"/> entity instances using the 'GetProduct' query.
        /// </summary>
        /// <returns>An EntityQuery that can be loaded to retrieve <see cref="Product"/> entity instances.</returns>
        public EntityQuery<Product> GetProductQuery()
        {
            this.ValidateMethod("GetProductQuery", null);
            return base.CreateQuery<Product>("GetProduct", null, false, true);
        }
        
        /// <summary>
        /// Gets an EntityQuery instance that can be used to load <see cref="ProductCategory"/> entity instances using the 'GetProductCategory' query.
        /// </summary>
        /// <returns>An EntityQuery that can be loaded to retrieve <see cref="ProductCategory"/> entity instances.</returns>
        public EntityQuery<ProductCategory> GetProductCategoryQuery()
        {
            this.ValidateMethod("GetProductCategoryQuery", null);
            return base.CreateQuery<ProductCategory>("GetProductCategory", null, false, true);
        }
        
        /// <summary>
        /// Creates a new EntityContainer for this DomainContext's EntitySets.
        /// </summary>
        /// <returns>A new container instance.</returns>
        protected override EntityContainer CreateEntityContainer()
        {
            return new AdventureWorksDomainContextEntityContainer();
        }
        
        /// <summary>
        /// Service contract for the 'AdventureWorksDomainService' DomainService.
        /// </summary>
        [ServiceContract()]
        public interface IAdventureWorksDomainServiceContract
        {
            
            /// <summary>
            /// Asynchronously invokes the 'GetProduct' 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/AdventureWorksDomainService/GetProductDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AdventureWorksDomainService/GetProduct", ReplyAction="http://tempuri.org/AdventureWorksDomainService/GetProductResponse")]
            [WebGet()]
            IAsyncResult BeginGetProduct(AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginGetProduct'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginGetProduct'.</param>
            /// <returns>The 'QueryResult' returned from the 'GetProduct' operation.</returns>
            QueryResult<Product> EndGetProduct(IAsyncResult result);
            
            /// <summary>
            /// Asynchronously invokes the 'GetProductCategory' 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/AdventureWorksDomainService/GetProductCategoryDomainServiceFau" +
                "lt", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AdventureWorksDomainService/GetProductCategory", ReplyAction="http://tempuri.org/AdventureWorksDomainService/GetProductCategoryResponse")]
            [WebGet()]
            IAsyncResult BeginGetProductCategory(AsyncCallback callback, object asyncState);
            
            /// <summary>
            /// Completes the asynchronous operation begun by 'BeginGetProductCategory'.
            /// </summary>
            /// <param name="result">The IAsyncResult returned from 'BeginGetProductCategory'.</param>
            /// <returns>The 'QueryResult' returned from the 'GetProductCategory' operation.</returns>
            QueryResult<ProductCategory> EndGetProductCategory(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/AdventureWorksDomainService/SubmitChangesDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
            [OperationContract(AsyncPattern=true, Action="http://tempuri.org/AdventureWorksDomainService/SubmitChanges", ReplyAction="http://tempuri.org/AdventureWorksDomainService/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 AdventureWorksDomainContextEntityContainer : EntityContainer
        {
            
            public AdventureWorksDomainContextEntityContainer()
            {
                this.CreateEntitySet<Product>(EntitySetOperations.None);
                this.CreateEntitySet<ProductCategory>(EntitySetOperations.All);
            }
        }
    }
}
