Prism for Windows Runtimeを使ったODataの更新アプリサンプル

サンプルプログラムの概要このサンプルプログラムは、http://www.odata.org/odata-services/のOData(read/write)で定義されているPersonエンティティを読み込んでNameプロパティを編集するサンプルプログラムです。以下のような動作をします。起動直後は、何も表示されません。アプリバーに表示されている読み込みボタンを選択すると、データが読み込まれて表示されます。読み込まれたデータを選択するとNameプロパティの編集用画面に遷移します。データを編集して、アプリバーの保存ボタンを選択すると、データがサーバーに反映さ

C# (114.3 KB)
 
 
 
 
 
(0)
37 times
Add to favorites
10/10/2014
E-mail Twitter del.icio.us Digg Facebook
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.36323
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

// Generation date: 10/10/2014 4:49:56 PM
namespace ODataReadWriteSampleApp.Models.OData
{
    /// <summary>
    /// There are no comments for DemoService in the schema.
    /// </summary>
    [global::Microsoft.OData.Client.OriginalNameAttribute("DemoService")]
    public partial class DemoService : global::Microsoft.OData.Client.DataServiceContext
    {
        /// <summary>
        /// Initialize a new DemoService object.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public DemoService(global::System.Uri serviceRoot) : 
                base(serviceRoot, global::Microsoft.OData.Client.ODataProtocolVersion.V4)
        {
            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();
            this.Format.LoadServiceModel = GeneratedEdmModel.GetInstance;
            this.Format.UseJson();
        }
        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>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        protected global::System.Type ResolveTypeFromName(string typeName)
        {
            global::System.Type resolvedType = this.DefaultResolveType(typeName, "ODataDemo", "ODataReadWriteSampleApp.Models.OData");
            if ((resolvedType != null))
            {
                return resolvedType;
            }
            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>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        protected string ResolveNameFromType(global::System.Type clientType)
        {
            global::Microsoft.OData.Client.OriginalNameAttribute originalNameAttribute = (global::Microsoft.OData.Client.OriginalNameAttribute)global::System.Linq.Enumerable.SingleOrDefault(global::Microsoft.OData.Client.Utility.GetCustomAttributes(clientType, typeof(global::Microsoft.OData.Client.OriginalNameAttribute), true));
            if (clientType.Namespace.Equals("ODataReadWriteSampleApp.Models.OData", global::System.StringComparison.Ordinal))
            {
                if (originalNameAttribute != null)
                {
                    return string.Concat("ODataDemo.", originalNameAttribute.OriginalName);
                }
                return string.Concat("ODataDemo.", clientType.Name);
            }
            if (originalNameAttribute != null)
            {
                return clientType.Namespace + "." + originalNameAttribute.OriginalName;
            }
            return clientType.FullName;
        }
        /// <summary>
        /// There are no comments for Products in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public global::Microsoft.OData.Client.DataServiceQuery<Product> Products
        {
            get
            {
                if ((this._Products == null))
                {
                    this._Products = base.CreateQuery<Product>("Products");
                }
                return this._Products;
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::Microsoft.OData.Client.DataServiceQuery<Product> _Products;
        /// <summary>
        /// There are no comments for ProductDetails in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public global::Microsoft.OData.Client.DataServiceQuery<ProductDetail> ProductDetails
        {
            get
            {
                if ((this._ProductDetails == null))
                {
                    this._ProductDetails = base.CreateQuery<ProductDetail>("ProductDetails");
                }
                return this._ProductDetails;
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::Microsoft.OData.Client.DataServiceQuery<ProductDetail> _ProductDetails;
        /// <summary>
        /// There are no comments for Categories in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public global::Microsoft.OData.Client.DataServiceQuery<Category> Categories
        {
            get
            {
                if ((this._Categories == null))
                {
                    this._Categories = base.CreateQuery<Category>("Categories");
                }
                return this._Categories;
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::Microsoft.OData.Client.DataServiceQuery<Category> _Categories;
        /// <summary>
        /// There are no comments for Suppliers in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public global::Microsoft.OData.Client.DataServiceQuery<Supplier> Suppliers
        {
            get
            {
                if ((this._Suppliers == null))
                {
                    this._Suppliers = base.CreateQuery<Supplier>("Suppliers");
                }
                return this._Suppliers;
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::Microsoft.OData.Client.DataServiceQuery<Supplier> _Suppliers;
        /// <summary>
        /// There are no comments for Persons in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public global::Microsoft.OData.Client.DataServiceQuery<Person> Persons
        {
            get
            {
                if ((this._Persons == null))
                {
                    this._Persons = base.CreateQuery<Person>("Persons");
                }
                return this._Persons;
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::Microsoft.OData.Client.DataServiceQuery<Person> _Persons;
        /// <summary>
        /// There are no comments for PersonDetails in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public global::Microsoft.OData.Client.DataServiceQuery<PersonDetail> PersonDetails
        {
            get
            {
                if ((this._PersonDetails == null))
                {
                    this._PersonDetails = base.CreateQuery<PersonDetail>("PersonDetails");
                }
                return this._PersonDetails;
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::Microsoft.OData.Client.DataServiceQuery<PersonDetail> _PersonDetails;
        /// <summary>
        /// There are no comments for Advertisements in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public global::Microsoft.OData.Client.DataServiceQuery<Advertisement> Advertisements
        {
            get
            {
                if ((this._Advertisements == null))
                {
                    this._Advertisements = base.CreateQuery<Advertisement>("Advertisements");
                }
                return this._Advertisements;
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::Microsoft.OData.Client.DataServiceQuery<Advertisement> _Advertisements;
        /// <summary>
        /// There are no comments for Products in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public void AddToProducts(Product product)
        {
            base.AddObject("Products", product);
        }
        /// <summary>
        /// There are no comments for ProductDetails in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public void AddToProductDetails(ProductDetail productDetail)
        {
            base.AddObject("ProductDetails", productDetail);
        }
        /// <summary>
        /// There are no comments for Categories in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public void AddToCategories(Category category)
        {
            base.AddObject("Categories", category);
        }
        /// <summary>
        /// There are no comments for Suppliers in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public void AddToSuppliers(Supplier supplier)
        {
            base.AddObject("Suppliers", supplier);
        }
        /// <summary>
        /// There are no comments for Persons in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public void AddToPersons(Person person)
        {
            base.AddObject("Persons", person);
        }
        /// <summary>
        /// There are no comments for PersonDetails in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public void AddToPersonDetails(PersonDetail personDetail)
        {
            base.AddObject("PersonDetails", personDetail);
        }
        /// <summary>
        /// There are no comments for Advertisements in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public void AddToAdvertisements(Advertisement advertisement)
        {
            base.AddObject("Advertisements", advertisement);
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private abstract class GeneratedEdmModel
        {
            [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
            private static global::Microsoft.OData.Edm.IEdmModel ParsedModel = LoadModelFromString();
            [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
            private const string Edmx = @"<edmx:Edmx Version=""4.0"" xmlns:edmx=""http://docs.oasis-open.org/odata/ns/edmx"">
  <edmx:DataServices>
    <Schema Namespace=""ODataDemo"" xmlns=""http://docs.oasis-open.org/odata/ns/edm"">
      <EntityType Name=""Product"">
        <Key>
          <PropertyRef Name=""ID"" />
        </Key>
        <Property Name=""ID"" Type=""Edm.Int32"" Nullable=""false"" />
        <Property Name=""Name"" Type=""Edm.String"" />
        <Property Name=""Description"" Type=""Edm.String"" />
        <Property Name=""ReleaseDate"" Type=""Edm.DateTimeOffset"" Nullable=""false"" />
        <Property Name=""DiscontinuedDate"" Type=""Edm.DateTimeOffset"" />
        <Property Name=""Rating"" Type=""Edm.Int16"" Nullable=""false"" />
        <Property Name=""Price"" Type=""Edm.Double"" Nullable=""false"" />
        <NavigationProperty Name=""Categories"" Type=""Collection(ODataDemo.Category)"" Partner=""Products"" />
        <NavigationProperty Name=""Supplier"" Type=""ODataDemo.Supplier"" Partner=""Products"" />
        <NavigationProperty Name=""ProductDetail"" Type=""ODataDemo.ProductDetail"" Partner=""Product"" />
      </EntityType>
      <EntityType Name=""FeaturedProduct"" BaseType=""ODataDemo.Product"">
        <NavigationProperty Name=""Advertisement"" Type=""ODataDemo.Advertisement"" Partner=""FeaturedProduct"" />
      </EntityType>
      <EntityType Name=""ProductDetail"">
        <Key>
          <PropertyRef Name=""ProductID"" />
        </Key>
        <Property Name=""ProductID"" Type=""Edm.Int32"" Nullable=""false"" />
        <Property Name=""Details"" Type=""Edm.String"" />
        <NavigationProperty Name=""Product"" Type=""ODataDemo.Product"" Partner=""ProductDetail"" />
      </EntityType>
      <EntityType Name=""Category"" OpenType=""true"">
        <Key>
          <PropertyRef Name=""ID"" />
        </Key>
        <Property Name=""ID"" Type=""Edm.Int32"" Nullable=""false"" />
        <Property Name=""Name"" Type=""Edm.String"" />
        <NavigationProperty Name=""Products"" Type=""Collection(ODataDemo.Product)"" Partner=""Categories"" />
      </EntityType>
      <EntityType Name=""Supplier"">
        <Key>
          <PropertyRef Name=""ID"" />
        </Key>
        <Property Name=""ID"" Type=""Edm.Int32"" Nullable=""false"" />
        <Property Name=""Name"" Type=""Edm.String"" />
        <Property Name=""Address"" Type=""ODataDemo.Address"" />
        <Property Name=""Location"" Type=""Edm.GeographyPoint"" SRID=""Variable"" />
        <Property Name=""Concurrency"" Type=""Edm.Int32"" ConcurrencyMode=""Fixed"" Nullable=""false"" />
        <NavigationProperty Name=""Products"" Type=""Collection(ODataDemo.Product)"" Partner=""Supplier"" />
      </EntityType>
      <ComplexType Name=""Address"">
        <Property Name=""Street"" Type=""Edm.String"" />
        <Property Name=""City"" Type=""Edm.String"" />
        <Property Name=""State"" Type=""Edm.String"" />
        <Property Name=""ZipCode"" Type=""Edm.String"" />
        <Property Name=""Country"" Type=""Edm.String"" />
      </ComplexType>
      <EntityType Name=""Person"">
        <Key>
          <PropertyRef Name=""ID"" />
        </Key>
        <Property Name=""ID"" Type=""Edm.Int32"" Nullable=""false"" />
        <Property Name=""Name"" Type=""Edm.String"" />
        <NavigationProperty Name=""PersonDetail"" Type=""ODataDemo.PersonDetail"" Partner=""Person"" />
      </EntityType>
      <EntityType Name=""Customer"" BaseType=""ODataDemo.Person"">
        <Property Name=""TotalExpense"" Type=""Edm.Decimal"" Nullable=""false"" />
      </EntityType>
      <EntityType Name=""Employee"" BaseType=""ODataDemo.Person"">
        <Property Name=""EmployeeID"" Type=""Edm.Int64"" Nullable=""false"" />
        <Property Name=""HireDate"" Type=""Edm.DateTimeOffset"" Nullable=""false"" />
        <Property Name=""Salary"" Type=""Edm.Single"" Nullable=""false"" />
      </EntityType>
      <EntityType Name=""PersonDetail"">
        <Key>
          <PropertyRef Name=""PersonID"" />
        </Key>
        <Property Name=""PersonID"" Type=""Edm.Int32"" Nullable=""false"" />
        <Property Name=""Age"" Type=""Edm.Byte"" Nullable=""false"" />
        <Property Name=""Gender"" Type=""Edm.Boolean"" Nullable=""false"" />
        <Property Name=""Phone"" Type=""Edm.String"" />
        <Property Name=""Address"" Type=""ODataDemo.Address"" />
        <Property Name=""Photo"" Type=""Edm.Stream"" Nullable=""false"" />
        <NavigationProperty Name=""Person"" Type=""ODataDemo.Person"" Partner=""PersonDetail"" />
      </EntityType>
      <EntityType Name=""Advertisement"" HasStream=""true"">
        <Key>
          <PropertyRef Name=""ID"" />
        </Key>
        <Property Name=""ID"" Type=""Edm.Guid"" Nullable=""false"" />
        <Property Name=""Name"" Type=""Edm.String"" />
        <Property Name=""AirDate"" Type=""Edm.DateTimeOffset"" Nullable=""false"" />
        <NavigationProperty Name=""FeaturedProduct"" Type=""ODataDemo.FeaturedProduct"" Partner=""Advertisement"" />
      </EntityType>
      <Action Name=""Discount"" IsBound=""true"">
        <Parameter Name=""product"" Type=""ODataDemo.Product"" />
        <Parameter Name=""discountPercentage"" Type=""Edm.Int32"" Nullable=""false"" />
        <ReturnType Type=""Edm.Double"" Nullable=""false"" />
      </Action>
      <Action Name=""IncreaseSalaries"">
        <Parameter Name=""percentage"" Type=""Edm.Int32"" Nullable=""false"" />
      </Action>
      <EntityContainer Name=""DemoService"">
        <EntitySet Name=""Products"" EntityType=""ODataDemo.Product"">
          <NavigationPropertyBinding Path=""ODataDemo.FeaturedProduct/Advertisement"" Target=""Advertisements"" />
          <NavigationPropertyBinding Path=""Categories"" Target=""Categories"" />
          <NavigationPropertyBinding Path=""Supplier"" Target=""Suppliers"" />
          <NavigationPropertyBinding Path=""ProductDetail"" Target=""ProductDetails"" />
        </EntitySet>
        <EntitySet Name=""ProductDetails"" EntityType=""ODataDemo.ProductDetail"">
          <NavigationPropertyBinding Path=""Product"" Target=""Products"" />
        </EntitySet>
        <EntitySet Name=""Categories"" EntityType=""ODataDemo.Category"">
          <NavigationPropertyBinding Path=""Products"" Target=""Products"" />
        </EntitySet>
        <EntitySet Name=""Suppliers"" EntityType=""ODataDemo.Supplier"">
          <NavigationPropertyBinding Path=""Products"" Target=""Products"" />
        </EntitySet>
        <EntitySet Name=""Persons"" EntityType=""ODataDemo.Person"">
          <NavigationPropertyBinding Path=""PersonDetail"" Target=""PersonDetails"" />
        </EntitySet>
        <EntitySet Name=""PersonDetails"" EntityType=""ODataDemo.PersonDetail"">
          <NavigationPropertyBinding Path=""Person"" Target=""Persons"" />
        </EntitySet>
        <EntitySet Name=""Advertisements"" EntityType=""ODataDemo.Advertisement"">
          <NavigationPropertyBinding Path=""FeaturedProduct"" Target=""Products"" />
        </EntitySet>
        <ActionImport Name=""IncreaseSalaries"" Action=""ODataDemo.IncreaseSalaries"" />
      </EntityContainer>
      <Annotations Target=""ODataDemo.DemoService"">
        <Annotation Term=""Org.OData.Display.V1.Description"" String=""This is a sample OData service with vocabularies"" />
      </Annotations>
      <Annotations Target=""ODataDemo.Product"">
        <Annotation Term=""Org.OData.Display.V1.Description"" String=""All Products available in the online store"" />
      </Annotations>
      <Annotations Target=""ODataDemo.Product/Name"">
        <Annotation Term=""Org.OData.Display.V1.DisplayName"" String=""Product Name"" />
      </Annotations>
      <Annotations Target=""ODataDemo.DemoService/Suppliers"">
        <Annotation Term=""Org.OData.Publication.V1.PublisherName"" String=""Microsoft Corp."" />
        <Annotation Term=""Org.OData.Publication.V1.PublisherId"" String=""MSFT"" />
        <Annotation Term=""Org.OData.Publication.V1.Keywords"" String=""Inventory, Supplier, Advertisers, Sales, Finance"" />
        <Annotation Term=""Org.OData.Publication.V1.AttributionUrl"" String=""http://www.odata.org/"" />
        <Annotation Term=""Org.OData.Publication.V1.AttributionDescription"" String=""All rights reserved"" />
        <Annotation Term=""Org.OData.Publication.V1.DocumentationUrl "" String=""http://www.odata.org/"" />
        <Annotation Term=""Org.OData.Publication.V1.TermsOfUseUrl"" String=""All rights reserved"" />
        <Annotation Term=""Org.OData.Publication.V1.PrivacyPolicyUrl"" String=""http://www.odata.org/"" />
        <Annotation Term=""Org.OData.Publication.V1.LastModified"" String=""4/2/2013"" />
        <Annotation Term=""Org.OData.Publication.V1.ImageUrl "" String=""http://www.odata.org/"" />
      </Annotations>
    </Schema>
  </edmx:DataServices>
</edmx:Edmx>";
            [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
            public static global::Microsoft.OData.Edm.IEdmModel GetInstance()
            {
                return ParsedModel;
            }
            [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
            private static global::Microsoft.OData.Edm.IEdmModel LoadModelFromString()
            {
                global::System.Xml.XmlReader reader = CreateXmlReader(Edmx);
                try
                {
                    return global::Microsoft.OData.Edm.Csdl.EdmxReader.Parse(reader);
                }
                finally
                {
                    ((global::System.IDisposable)(reader)).Dispose();
                }
            }
            [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
            private static global::System.Xml.XmlReader CreateXmlReader(string edmxToParse)
            {
                return global::System.Xml.XmlReader.Create(new global::System.IO.StringReader(edmxToParse));
            }
        }
        /// <summary>
        /// There are no comments for IncreaseSalaries in the schema.
        /// </summary>
        public global::Microsoft.OData.Client.DataServiceActionQuery IncreaseSalaries(int percentage)
        {
            return new global::Microsoft.OData.Client.DataServiceActionQuery(this, this.BaseUri.OriginalString.Trim('/') + "/IncreaseSalaries", new global::Microsoft.OData.Client.BodyOperationParameter("percentage", percentage));
        }
    }
    /// <summary>
    /// There are no comments for ProductSingle in the schema.
    /// </summary>
    [global::Microsoft.OData.Client.OriginalNameAttribute("ProductSingle")]
    public partial class ProductSingle : global::Microsoft.OData.Client.DataServiceQuerySingle<Product>
    {
        /// <summary>
        /// Initialize a new ProductSingle object.
        /// </summary>
        public ProductSingle(global::Microsoft.OData.Client.DataServiceContext context, string path)
            : base(context, path) {}

        /// <summary>
        /// Initialize a new ProductSingle object.
        /// </summary>
        public ProductSingle(global::Microsoft.OData.Client.DataServiceContext context, string path, bool isComposable)
            : base(context, path, isComposable) {}
        /// <summary>
        /// There are no comments for Categories in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public global::Microsoft.OData.Client.DataServiceQuery<global::ODataReadWriteSampleApp.Models.OData.Category> Categories
        {
            get
            {
                if (!this.IsComposable)
                {
                    throw new global::System.NotSupportedException("The previous function is not composable.");
                }
                if ((this._Categories == null))
                {
                    this._Categories = Context.CreateQuery<global::ODataReadWriteSampleApp.Models.OData.Category>(GetPath("Categories"));
                }
                return this._Categories;
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::Microsoft.OData.Client.DataServiceQuery<global::ODataReadWriteSampleApp.Models.OData.Category> _Categories;
        /// <summary>
        /// There are no comments for Supplier in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public global::ODataReadWriteSampleApp.Models.OData.SupplierSingle Supplier
        {
            get
            {
                if (!this.IsComposable)
                {
                    throw new global::System.NotSupportedException("The previous function is not composable.");
                }
                if ((this._Supplier == null))
                {
                    this._Supplier = new global::ODataReadWriteSampleApp.Models.OData.SupplierSingle(this.Context, GetPath("Supplier"));
                }
                return this._Supplier;
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::ODataReadWriteSampleApp.Models.OData.SupplierSingle _Supplier;
        /// <summary>
        /// There are no comments for ProductDetail in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public global::ODataReadWriteSampleApp.Models.OData.ProductDetailSingle ProductDetail
        {
            get
            {
                if (!this.IsComposable)
                {
                    throw new global::System.NotSupportedException("The previous function is not composable.");
                }
                if ((this._ProductDetail == null))
                {
                    this._ProductDetail = new global::ODataReadWriteSampleApp.Models.OData.ProductDetailSingle(this.Context, GetPath("ProductDetail"));
                }
                return this._ProductDetail;
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::ODataReadWriteSampleApp.Models.OData.ProductDetailSingle _ProductDetail;
    }
    /// <summary>
    /// There are no comments for Product in the schema.
    /// </summary>
    /// <KeyProperties>
    /// ID
    /// </KeyProperties>
    [global::Microsoft.OData.Client.Key("ID")]
    [global::Microsoft.OData.Client.EntitySet("Products")]
    [global::Microsoft.OData.Client.OriginalNameAttribute("Product")]
    public partial class Product : global::Microsoft.OData.Client.BaseEntityType, global::System.ComponentModel.INotifyPropertyChanged
    {
        /// <summary>
        /// Create a new Product object.
        /// </summary>
        /// <param name="ID">Initial value of ID.</param>
        /// <param name="releaseDate">Initial value of ReleaseDate.</param>
        /// <param name="rating">Initial value of Rating.</param>
        /// <param name="price">Initial value of Price.</param>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public static Product CreateProduct(int ID, global::System.DateTimeOffset releaseDate, short rating, double price)
        {
            Product product = new Product();
            product.ID = ID;
            product.ReleaseDate = releaseDate;
            product.Rating = rating;
            product.Price = price;
            return product;
        }
        /// <summary>
        /// There are no comments for Property ID in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("ID")]
        public int ID
        {
            get
            {
                return this._ID;
            }
            set
            {
                this.OnIDChanging(value);
                this._ID = value;
                this.OnIDChanged();
                this.OnPropertyChanged("ID");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private int _ID;
        partial void OnIDChanging(int value);
        partial void OnIDChanged();
        /// <summary>
        /// There are no comments for Property Name in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("Name")]
        public string Name
        {
            get
            {
                return this._Name;
            }
            set
            {
                this.OnNameChanging(value);
                this._Name = value;
                this.OnNameChanged();
                this.OnPropertyChanged("Name");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private string _Name;
        partial void OnNameChanging(string value);
        partial void OnNameChanged();
        /// <summary>
        /// There are no comments for Property Description in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("Description")]
        public string Description
        {
            get
            {
                return this._Description;
            }
            set
            {
                this.OnDescriptionChanging(value);
                this._Description = value;
                this.OnDescriptionChanged();
                this.OnPropertyChanged("Description");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private string _Description;
        partial void OnDescriptionChanging(string value);
        partial void OnDescriptionChanged();
        /// <summary>
        /// There are no comments for Property ReleaseDate in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("ReleaseDate")]
        public global::System.DateTimeOffset ReleaseDate
        {
            get
            {
                return this._ReleaseDate;
            }
            set
            {
                this.OnReleaseDateChanging(value);
                this._ReleaseDate = value;
                this.OnReleaseDateChanged();
                this.OnPropertyChanged("ReleaseDate");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::System.DateTimeOffset _ReleaseDate;
        partial void OnReleaseDateChanging(global::System.DateTimeOffset value);
        partial void OnReleaseDateChanged();
        /// <summary>
        /// There are no comments for Property DiscontinuedDate in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("DiscontinuedDate")]
        public global::System.Nullable<global::System.DateTimeOffset> DiscontinuedDate
        {
            get
            {
                return this._DiscontinuedDate;
            }
            set
            {
                this.OnDiscontinuedDateChanging(value);
                this._DiscontinuedDate = value;
                this.OnDiscontinuedDateChanged();
                this.OnPropertyChanged("DiscontinuedDate");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::System.Nullable<global::System.DateTimeOffset> _DiscontinuedDate;
        partial void OnDiscontinuedDateChanging(global::System.Nullable<global::System.DateTimeOffset> value);
        partial void OnDiscontinuedDateChanged();
        /// <summary>
        /// There are no comments for Property Rating in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("Rating")]
        public short Rating
        {
            get
            {
                return this._Rating;
            }
            set
            {
                this.OnRatingChanging(value);
                this._Rating = value;
                this.OnRatingChanged();
                this.OnPropertyChanged("Rating");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private short _Rating;
        partial void OnRatingChanging(short value);
        partial void OnRatingChanged();
        /// <summary>
        /// There are no comments for Property Price in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("Price")]
        public double Price
        {
            get
            {
                return this._Price;
            }
            set
            {
                this.OnPriceChanging(value);
                this._Price = value;
                this.OnPriceChanged();
                this.OnPropertyChanged("Price");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private double _Price;
        partial void OnPriceChanging(double value);
        partial void OnPriceChanged();
        /// <summary>
        /// There are no comments for Property Categories in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("Categories")]
        public global::Microsoft.OData.Client.DataServiceCollection<global::ODataReadWriteSampleApp.Models.OData.Category> Categories
        {
            get
            {
                return this._Categories;
            }
            set
            {
                this.OnCategoriesChanging(value);
                this._Categories = value;
                this.OnCategoriesChanged();
                this.OnPropertyChanged("Categories");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::Microsoft.OData.Client.DataServiceCollection<global::ODataReadWriteSampleApp.Models.OData.Category> _Categories = new global::Microsoft.OData.Client.DataServiceCollection<global::ODataReadWriteSampleApp.Models.OData.Category>(null, global::Microsoft.OData.Client.TrackingMode.None);
        partial void OnCategoriesChanging(global::Microsoft.OData.Client.DataServiceCollection<global::ODataReadWriteSampleApp.Models.OData.Category> value);
        partial void OnCategoriesChanged();
        /// <summary>
        /// There are no comments for Property Supplier in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("Supplier")]
        public global::ODataReadWriteSampleApp.Models.OData.Supplier Supplier
        {
            get
            {
                return this._Supplier;
            }
            set
            {
                this.OnSupplierChanging(value);
                this._Supplier = value;
                this.OnSupplierChanged();
                this.OnPropertyChanged("Supplier");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::ODataReadWriteSampleApp.Models.OData.Supplier _Supplier;
        partial void OnSupplierChanging(global::ODataReadWriteSampleApp.Models.OData.Supplier value);
        partial void OnSupplierChanged();
        /// <summary>
        /// There are no comments for Property ProductDetail in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("ProductDetail")]
        public global::ODataReadWriteSampleApp.Models.OData.ProductDetail ProductDetail
        {
            get
            {
                return this._ProductDetail;
            }
            set
            {
                this.OnProductDetailChanging(value);
                this._ProductDetail = value;
                this.OnProductDetailChanged();
                this.OnPropertyChanged("ProductDetail");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::ODataReadWriteSampleApp.Models.OData.ProductDetail _ProductDetail;
        partial void OnProductDetailChanging(global::ODataReadWriteSampleApp.Models.OData.ProductDetail value);
        partial void OnProductDetailChanged();
        /// <summary>
        /// This event is raised when the value of the property is changed
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public event global::System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
        /// <summary>
        /// The value of the property is changed
        /// </summary>
        /// <param name="property">property name</param>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        protected virtual void OnPropertyChanged(string property)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new global::System.ComponentModel.PropertyChangedEventArgs(property));
            }
        }
        /// <summary>
        /// There are no comments for Discount in the schema.
        /// </summary>
        public global::Microsoft.OData.Client.DataServiceActionQuerySingle<double> Discount(int discountPercentage)
        {
            global::Microsoft.OData.Client.EntityDescriptor resource = Context.EntityTracker.TryGetEntityDescriptor(this);
            if (resource == null)
            {
                throw new global::System.Exception("cannot find entity");
            }

            return new global::Microsoft.OData.Client.DataServiceActionQuerySingle<double>(this.Context, resource.EditLink.OriginalString.Trim('/') + "/ODataDemo.Discount", new global::Microsoft.OData.Client.BodyOperationParameter("discountPercentage", discountPercentage));
        }
    }
    /// <summary>
    /// There are no comments for FeaturedProductSingle in the schema.
    /// </summary>
    [global::Microsoft.OData.Client.OriginalNameAttribute("FeaturedProductSingle")]
    public partial class FeaturedProductSingle : global::Microsoft.OData.Client.DataServiceQuerySingle<FeaturedProduct>
    {
        /// <summary>
        /// Initialize a new FeaturedProductSingle object.
        /// </summary>
        public FeaturedProductSingle(global::Microsoft.OData.Client.DataServiceContext context, string path)
            : base(context, path) {}

        /// <summary>
        /// Initialize a new FeaturedProductSingle object.
        /// </summary>
        public FeaturedProductSingle(global::Microsoft.OData.Client.DataServiceContext context, string path, bool isComposable)
            : base(context, path, isComposable) {}
        /// <summary>
        /// There are no comments for Advertisement in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public global::ODataReadWriteSampleApp.Models.OData.AdvertisementSingle Advertisement
        {
            get
            {
                if (!this.IsComposable)
                {
                    throw new global::System.NotSupportedException("The previous function is not composable.");
                }
                if ((this._Advertisement == null))
                {
                    this._Advertisement = new global::ODataReadWriteSampleApp.Models.OData.AdvertisementSingle(this.Context, GetPath("Advertisement"));
                }
                return this._Advertisement;
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::ODataReadWriteSampleApp.Models.OData.AdvertisementSingle _Advertisement;
        /// <summary>
        /// There are no comments for Categories in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public global::Microsoft.OData.Client.DataServiceQuery<global::ODataReadWriteSampleApp.Models.OData.Category> Categories
        {
            get
            {
                if (!this.IsComposable)
                {
                    throw new global::System.NotSupportedException("The previous function is not composable.");
                }
                if ((this._Categories == null))
                {
                    this._Categories = Context.CreateQuery<global::ODataReadWriteSampleApp.Models.OData.Category>(GetPath("Categories"));
                }
                return this._Categories;
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::Microsoft.OData.Client.DataServiceQuery<global::ODataReadWriteSampleApp.Models.OData.Category> _Categories;
        /// <summary>
        /// There are no comments for Supplier in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public global::ODataReadWriteSampleApp.Models.OData.SupplierSingle Supplier
        {
            get
            {
                if (!this.IsComposable)
                {
                    throw new global::System.NotSupportedException("The previous function is not composable.");
                }
                if ((this._Supplier == null))
                {
                    this._Supplier = new global::ODataReadWriteSampleApp.Models.OData.SupplierSingle(this.Context, GetPath("Supplier"));
                }
                return this._Supplier;
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::ODataReadWriteSampleApp.Models.OData.SupplierSingle _Supplier;
        /// <summary>
        /// There are no comments for ProductDetail in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public global::ODataReadWriteSampleApp.Models.OData.ProductDetailSingle ProductDetail
        {
            get
            {
                if (!this.IsComposable)
                {
                    throw new global::System.NotSupportedException("The previous function is not composable.");
                }
                if ((this._ProductDetail == null))
                {
                    this._ProductDetail = new global::ODataReadWriteSampleApp.Models.OData.ProductDetailSingle(this.Context, GetPath("ProductDetail"));
                }
                return this._ProductDetail;
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::ODataReadWriteSampleApp.Models.OData.ProductDetailSingle _ProductDetail;
    }
    /// <summary>
    /// There are no comments for FeaturedProduct in the schema.
    /// </summary>
    /// <KeyProperties>
    /// ID
    /// </KeyProperties>
    [global::Microsoft.OData.Client.Key("ID")]
    [global::Microsoft.OData.Client.OriginalNameAttribute("FeaturedProduct")]
    public partial class FeaturedProduct : Product
    {
        /// <summary>
        /// Create a new FeaturedProduct object.
        /// </summary>
        /// <param name="ID">Initial value of ID.</param>
        /// <param name="releaseDate">Initial value of ReleaseDate.</param>
        /// <param name="rating">Initial value of Rating.</param>
        /// <param name="price">Initial value of Price.</param>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public static FeaturedProduct CreateFeaturedProduct(int ID, global::System.DateTimeOffset releaseDate, short rating, double price)
        {
            FeaturedProduct featuredProduct = new FeaturedProduct();
            featuredProduct.ID = ID;
            featuredProduct.ReleaseDate = releaseDate;
            featuredProduct.Rating = rating;
            featuredProduct.Price = price;
            return featuredProduct;
        }
        /// <summary>
        /// There are no comments for Property Advertisement in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("Advertisement")]
        public global::ODataReadWriteSampleApp.Models.OData.Advertisement Advertisement
        {
            get
            {
                return this._Advertisement;
            }
            set
            {
                this.OnAdvertisementChanging(value);
                this._Advertisement = value;
                this.OnAdvertisementChanged();
                this.OnPropertyChanged("Advertisement");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::ODataReadWriteSampleApp.Models.OData.Advertisement _Advertisement;
        partial void OnAdvertisementChanging(global::ODataReadWriteSampleApp.Models.OData.Advertisement value);
        partial void OnAdvertisementChanged();
    }
    /// <summary>
    /// There are no comments for ProductDetailSingle in the schema.
    /// </summary>
    [global::Microsoft.OData.Client.OriginalNameAttribute("ProductDetailSingle")]
    public partial class ProductDetailSingle : global::Microsoft.OData.Client.DataServiceQuerySingle<ProductDetail>
    {
        /// <summary>
        /// Initialize a new ProductDetailSingle object.
        /// </summary>
        public ProductDetailSingle(global::Microsoft.OData.Client.DataServiceContext context, string path)
            : base(context, path) {}

        /// <summary>
        /// Initialize a new ProductDetailSingle object.
        /// </summary>
        public ProductDetailSingle(global::Microsoft.OData.Client.DataServiceContext context, string path, bool isComposable)
            : base(context, path, isComposable) {}
        /// <summary>
        /// There are no comments for Product in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public global::ODataReadWriteSampleApp.Models.OData.ProductSingle Product
        {
            get
            {
                if (!this.IsComposable)
                {
                    throw new global::System.NotSupportedException("The previous function is not composable.");
                }
                if ((this._Product == null))
                {
                    this._Product = new global::ODataReadWriteSampleApp.Models.OData.ProductSingle(this.Context, GetPath("Product"));
                }
                return this._Product;
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::ODataReadWriteSampleApp.Models.OData.ProductSingle _Product;
    }
    /// <summary>
    /// There are no comments for ProductDetail in the schema.
    /// </summary>
    /// <KeyProperties>
    /// ProductID
    /// </KeyProperties>
    [global::Microsoft.OData.Client.Key("ProductID")]
    [global::Microsoft.OData.Client.EntitySet("ProductDetails")]
    [global::Microsoft.OData.Client.OriginalNameAttribute("ProductDetail")]
    public partial class ProductDetail : global::Microsoft.OData.Client.BaseEntityType, global::System.ComponentModel.INotifyPropertyChanged
    {
        /// <summary>
        /// Create a new ProductDetail object.
        /// </summary>
        /// <param name="productID">Initial value of ProductID.</param>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public static ProductDetail CreateProductDetail(int productID)
        {
            ProductDetail productDetail = new ProductDetail();
            productDetail.ProductID = productID;
            return productDetail;
        }
        /// <summary>
        /// There are no comments for Property ProductID in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("ProductID")]
        public int ProductID
        {
            get
            {
                return this._ProductID;
            }
            set
            {
                this.OnProductIDChanging(value);
                this._ProductID = value;
                this.OnProductIDChanged();
                this.OnPropertyChanged("ProductID");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private int _ProductID;
        partial void OnProductIDChanging(int value);
        partial void OnProductIDChanged();
        /// <summary>
        /// There are no comments for Property Details in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("Details")]
        public string Details
        {
            get
            {
                return this._Details;
            }
            set
            {
                this.OnDetailsChanging(value);
                this._Details = value;
                this.OnDetailsChanged();
                this.OnPropertyChanged("Details");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private string _Details;
        partial void OnDetailsChanging(string value);
        partial void OnDetailsChanged();
        /// <summary>
        /// There are no comments for Property Product in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("Product")]
        public global::ODataReadWriteSampleApp.Models.OData.Product Product
        {
            get
            {
                return this._Product;
            }
            set
            {
                this.OnProductChanging(value);
                this._Product = value;
                this.OnProductChanged();
                this.OnPropertyChanged("Product");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::ODataReadWriteSampleApp.Models.OData.Product _Product;
        partial void OnProductChanging(global::ODataReadWriteSampleApp.Models.OData.Product value);
        partial void OnProductChanged();
        /// <summary>
        /// This event is raised when the value of the property is changed
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public event global::System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
        /// <summary>
        /// The value of the property is changed
        /// </summary>
        /// <param name="property">property name</param>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        protected virtual void OnPropertyChanged(string property)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new global::System.ComponentModel.PropertyChangedEventArgs(property));
            }
        }
    }
    /// <summary>
    /// There are no comments for CategorySingle in the schema.
    /// </summary>
    [global::Microsoft.OData.Client.OriginalNameAttribute("CategorySingle")]
    public partial class CategorySingle : global::Microsoft.OData.Client.DataServiceQuerySingle<Category>
    {
        /// <summary>
        /// Initialize a new CategorySingle object.
        /// </summary>
        public CategorySingle(global::Microsoft.OData.Client.DataServiceContext context, string path)
            : base(context, path) {}

        /// <summary>
        /// Initialize a new CategorySingle object.
        /// </summary>
        public CategorySingle(global::Microsoft.OData.Client.DataServiceContext context, string path, bool isComposable)
            : base(context, path, isComposable) {}
        /// <summary>
        /// There are no comments for Products in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public global::Microsoft.OData.Client.DataServiceQuery<global::ODataReadWriteSampleApp.Models.OData.Product> Products
        {
            get
            {
                if (!this.IsComposable)
                {
                    throw new global::System.NotSupportedException("The previous function is not composable.");
                }
                if ((this._Products == null))
                {
                    this._Products = Context.CreateQuery<global::ODataReadWriteSampleApp.Models.OData.Product>(GetPath("Products"));
                }
                return this._Products;
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::Microsoft.OData.Client.DataServiceQuery<global::ODataReadWriteSampleApp.Models.OData.Product> _Products;
    }
    /// <summary>
    /// There are no comments for Category in the schema.
    /// </summary>
    /// <KeyProperties>
    /// ID
    /// </KeyProperties>
    [global::Microsoft.OData.Client.Key("ID")]
    [global::Microsoft.OData.Client.EntitySet("Categories")]
    [global::Microsoft.OData.Client.OriginalNameAttribute("Category")]
    public partial class Category : global::Microsoft.OData.Client.BaseEntityType, global::System.ComponentModel.INotifyPropertyChanged
    {
        /// <summary>
        /// Create a new Category object.
        /// </summary>
        /// <param name="ID">Initial value of ID.</param>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public static Category CreateCategory(int ID)
        {
            Category category = new Category();
            category.ID = ID;
            return category;
        }
        /// <summary>
        /// There are no comments for Property ID in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("ID")]
        public int ID
        {
            get
            {
                return this._ID;
            }
            set
            {
                this.OnIDChanging(value);
                this._ID = value;
                this.OnIDChanged();
                this.OnPropertyChanged("ID");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private int _ID;
        partial void OnIDChanging(int value);
        partial void OnIDChanged();
        /// <summary>
        /// There are no comments for Property Name in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("Name")]
        public string Name
        {
            get
            {
                return this._Name;
            }
            set
            {
                this.OnNameChanging(value);
                this._Name = value;
                this.OnNameChanged();
                this.OnPropertyChanged("Name");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private string _Name;
        partial void OnNameChanging(string value);
        partial void OnNameChanged();
        /// <summary>
        /// There are no comments for Property Products in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("Products")]
        public global::Microsoft.OData.Client.DataServiceCollection<global::ODataReadWriteSampleApp.Models.OData.Product> Products
        {
            get
            {
                return this._Products;
            }
            set
            {
                this.OnProductsChanging(value);
                this._Products = value;
                this.OnProductsChanged();
                this.OnPropertyChanged("Products");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::Microsoft.OData.Client.DataServiceCollection<global::ODataReadWriteSampleApp.Models.OData.Product> _Products = new global::Microsoft.OData.Client.DataServiceCollection<global::ODataReadWriteSampleApp.Models.OData.Product>(null, global::Microsoft.OData.Client.TrackingMode.None);
        partial void OnProductsChanging(global::Microsoft.OData.Client.DataServiceCollection<global::ODataReadWriteSampleApp.Models.OData.Product> value);
        partial void OnProductsChanged();
        /// <summary>
        /// This event is raised when the value of the property is changed
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public event global::System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
        /// <summary>
        /// The value of the property is changed
        /// </summary>
        /// <param name="property">property name</param>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        protected virtual void OnPropertyChanged(string property)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new global::System.ComponentModel.PropertyChangedEventArgs(property));
            }
        }
    }
    /// <summary>
    /// There are no comments for SupplierSingle in the schema.
    /// </summary>
    [global::Microsoft.OData.Client.OriginalNameAttribute("SupplierSingle")]
    public partial class SupplierSingle : global::Microsoft.OData.Client.DataServiceQuerySingle<Supplier>
    {
        /// <summary>
        /// Initialize a new SupplierSingle object.
        /// </summary>
        public SupplierSingle(global::Microsoft.OData.Client.DataServiceContext context, string path)
            : base(context, path) {}

        /// <summary>
        /// Initialize a new SupplierSingle object.
        /// </summary>
        public SupplierSingle(global::Microsoft.OData.Client.DataServiceContext context, string path, bool isComposable)
            : base(context, path, isComposable) {}
        /// <summary>
        /// There are no comments for Products in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public global::Microsoft.OData.Client.DataServiceQuery<global::ODataReadWriteSampleApp.Models.OData.Product> Products
        {
            get
            {
                if (!this.IsComposable)
                {
                    throw new global::System.NotSupportedException("The previous function is not composable.");
                }
                if ((this._Products == null))
                {
                    this._Products = Context.CreateQuery<global::ODataReadWriteSampleApp.Models.OData.Product>(GetPath("Products"));
                }
                return this._Products;
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::Microsoft.OData.Client.DataServiceQuery<global::ODataReadWriteSampleApp.Models.OData.Product> _Products;
    }
    /// <summary>
    /// There are no comments for Supplier in the schema.
    /// </summary>
    /// <KeyProperties>
    /// ID
    /// </KeyProperties>
    [global::Microsoft.OData.Client.Key("ID")]
    [global::Microsoft.OData.Client.EntitySet("Suppliers")]
    [global::Microsoft.OData.Client.OriginalNameAttribute("Supplier")]
    public partial class Supplier : global::Microsoft.OData.Client.BaseEntityType, global::System.ComponentModel.INotifyPropertyChanged
    {
        /// <summary>
        /// Create a new Supplier object.
        /// </summary>
        /// <param name="ID">Initial value of ID.</param>
        /// <param name="concurrency">Initial value of Concurrency.</param>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public static Supplier CreateSupplier(int ID, int concurrency)
        {
            Supplier supplier = new Supplier();
            supplier.ID = ID;
            supplier.Concurrency = concurrency;
            return supplier;
        }
        /// <summary>
        /// There are no comments for Property ID in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("ID")]
        public int ID
        {
            get
            {
                return this._ID;
            }
            set
            {
                this.OnIDChanging(value);
                this._ID = value;
                this.OnIDChanged();
                this.OnPropertyChanged("ID");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private int _ID;
        partial void OnIDChanging(int value);
        partial void OnIDChanged();
        /// <summary>
        /// There are no comments for Property Name in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("Name")]
        public string Name
        {
            get
            {
                return this._Name;
            }
            set
            {
                this.OnNameChanging(value);
                this._Name = value;
                this.OnNameChanged();
                this.OnPropertyChanged("Name");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private string _Name;
        partial void OnNameChanging(string value);
        partial void OnNameChanged();
        /// <summary>
        /// There are no comments for Property Address in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("Address")]
        public global::ODataReadWriteSampleApp.Models.OData.Address Address
        {
            get
            {
                return this._Address;
            }
            set
            {
                this.OnAddressChanging(value);
                this._Address = value;
                this.OnAddressChanged();
                this.OnPropertyChanged("Address");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::ODataReadWriteSampleApp.Models.OData.Address _Address;
        partial void OnAddressChanging(global::ODataReadWriteSampleApp.Models.OData.Address value);
        partial void OnAddressChanged();
        /// <summary>
        /// There are no comments for Property Location in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("Location")]
        public global::Microsoft.Spatial.GeographyPoint Location
        {
            get
            {
                return this._Location;
            }
            set
            {
                this.OnLocationChanging(value);
                this._Location = value;
                this.OnLocationChanged();
                this.OnPropertyChanged("Location");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::Microsoft.Spatial.GeographyPoint _Location;
        partial void OnLocationChanging(global::Microsoft.Spatial.GeographyPoint value);
        partial void OnLocationChanged();
        /// <summary>
        /// There are no comments for Property Concurrency in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("Concurrency")]
        public int Concurrency
        {
            get
            {
                return this._Concurrency;
            }
            set
            {
                this.OnConcurrencyChanging(value);
                this._Concurrency = value;
                this.OnConcurrencyChanged();
                this.OnPropertyChanged("Concurrency");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private int _Concurrency;
        partial void OnConcurrencyChanging(int value);
        partial void OnConcurrencyChanged();
        /// <summary>
        /// There are no comments for Property Products in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("Products")]
        public global::Microsoft.OData.Client.DataServiceCollection<global::ODataReadWriteSampleApp.Models.OData.Product> Products
        {
            get
            {
                return this._Products;
            }
            set
            {
                this.OnProductsChanging(value);
                this._Products = value;
                this.OnProductsChanged();
                this.OnPropertyChanged("Products");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::Microsoft.OData.Client.DataServiceCollection<global::ODataReadWriteSampleApp.Models.OData.Product> _Products = new global::Microsoft.OData.Client.DataServiceCollection<global::ODataReadWriteSampleApp.Models.OData.Product>(null, global::Microsoft.OData.Client.TrackingMode.None);
        partial void OnProductsChanging(global::Microsoft.OData.Client.DataServiceCollection<global::ODataReadWriteSampleApp.Models.OData.Product> value);
        partial void OnProductsChanged();
        /// <summary>
        /// This event is raised when the value of the property is changed
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public event global::System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
        /// <summary>
        /// The value of the property is changed
        /// </summary>
        /// <param name="property">property name</param>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        protected virtual void OnPropertyChanged(string property)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new global::System.ComponentModel.PropertyChangedEventArgs(property));
            }
        }
    }
    /// <summary>
    /// There are no comments for Address in the schema.
    /// </summary>
    [global::Microsoft.OData.Client.OriginalNameAttribute("Address")]
    public partial class Address : global::System.ComponentModel.INotifyPropertyChanged
    {
        /// <summary>
        /// There are no comments for Property Street in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("Street")]
        public string Street
        {
            get
            {
                return this._Street;
            }
            set
            {
                this.OnStreetChanging(value);
                this._Street = value;
                this.OnStreetChanged();
                this.OnPropertyChanged("Street");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private string _Street;
        partial void OnStreetChanging(string value);
        partial void OnStreetChanged();
        /// <summary>
        /// There are no comments for Property City in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("City")]
        public string City
        {
            get
            {
                return this._City;
            }
            set
            {
                this.OnCityChanging(value);
                this._City = value;
                this.OnCityChanged();
                this.OnPropertyChanged("City");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private string _City;
        partial void OnCityChanging(string value);
        partial void OnCityChanged();
        /// <summary>
        /// There are no comments for Property State in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("State")]
        public string State
        {
            get
            {
                return this._State;
            }
            set
            {
                this.OnStateChanging(value);
                this._State = value;
                this.OnStateChanged();
                this.OnPropertyChanged("State");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private string _State;
        partial void OnStateChanging(string value);
        partial void OnStateChanged();
        /// <summary>
        /// There are no comments for Property ZipCode in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("ZipCode")]
        public string ZipCode
        {
            get
            {
                return this._ZipCode;
            }
            set
            {
                this.OnZipCodeChanging(value);
                this._ZipCode = value;
                this.OnZipCodeChanged();
                this.OnPropertyChanged("ZipCode");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private string _ZipCode;
        partial void OnZipCodeChanging(string value);
        partial void OnZipCodeChanged();
        /// <summary>
        /// There are no comments for Property Country in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("Country")]
        public string Country
        {
            get
            {
                return this._Country;
            }
            set
            {
                this.OnCountryChanging(value);
                this._Country = value;
                this.OnCountryChanged();
                this.OnPropertyChanged("Country");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private string _Country;
        partial void OnCountryChanging(string value);
        partial void OnCountryChanged();
        /// <summary>
        /// This event is raised when the value of the property is changed
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public event global::System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
        /// <summary>
        /// The value of the property is changed
        /// </summary>
        /// <param name="property">property name</param>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        protected virtual void OnPropertyChanged(string property)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new global::System.ComponentModel.PropertyChangedEventArgs(property));
            }
        }
    }
    /// <summary>
    /// There are no comments for PersonSingle in the schema.
    /// </summary>
    [global::Microsoft.OData.Client.OriginalNameAttribute("PersonSingle")]
    public partial class PersonSingle : global::Microsoft.OData.Client.DataServiceQuerySingle<Person>
    {
        /// <summary>
        /// Initialize a new PersonSingle object.
        /// </summary>
        public PersonSingle(global::Microsoft.OData.Client.DataServiceContext context, string path)
            : base(context, path) {}

        /// <summary>
        /// Initialize a new PersonSingle object.
        /// </summary>
        public PersonSingle(global::Microsoft.OData.Client.DataServiceContext context, string path, bool isComposable)
            : base(context, path, isComposable) {}
        /// <summary>
        /// There are no comments for PersonDetail in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public global::ODataReadWriteSampleApp.Models.OData.PersonDetailSingle PersonDetail
        {
            get
            {
                if (!this.IsComposable)
                {
                    throw new global::System.NotSupportedException("The previous function is not composable.");
                }
                if ((this._PersonDetail == null))
                {
                    this._PersonDetail = new global::ODataReadWriteSampleApp.Models.OData.PersonDetailSingle(this.Context, GetPath("PersonDetail"));
                }
                return this._PersonDetail;
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::ODataReadWriteSampleApp.Models.OData.PersonDetailSingle _PersonDetail;
    }
    /// <summary>
    /// There are no comments for Person in the schema.
    /// </summary>
    /// <KeyProperties>
    /// ID
    /// </KeyProperties>
    [global::Microsoft.OData.Client.Key("ID")]
    [global::Microsoft.OData.Client.EntitySet("Persons")]
    [global::Microsoft.OData.Client.OriginalNameAttribute("Person")]
    public partial class Person : global::Microsoft.OData.Client.BaseEntityType, global::System.ComponentModel.INotifyPropertyChanged
    {
        /// <summary>
        /// Create a new Person object.
        /// </summary>
        /// <param name="ID">Initial value of ID.</param>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public static Person CreatePerson(int ID)
        {
            Person person = new Person();
            person.ID = ID;
            return person;
        }
        /// <summary>
        /// There are no comments for Property ID in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("ID")]
        public int ID
        {
            get
            {
                return this._ID;
            }
            set
            {
                this.OnIDChanging(value);
                this._ID = value;
                this.OnIDChanged();
                this.OnPropertyChanged("ID");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private int _ID;
        partial void OnIDChanging(int value);
        partial void OnIDChanged();
        /// <summary>
        /// There are no comments for Property Name in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("Name")]
        public string Name
        {
            get
            {
                return this._Name;
            }
            set
            {
                this.OnNameChanging(value);
                this._Name = value;
                this.OnNameChanged();
                this.OnPropertyChanged("Name");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private string _Name;
        partial void OnNameChanging(string value);
        partial void OnNameChanged();
        /// <summary>
        /// There are no comments for Property PersonDetail in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("PersonDetail")]
        public global::ODataReadWriteSampleApp.Models.OData.PersonDetail PersonDetail
        {
            get
            {
                return this._PersonDetail;
            }
            set
            {
                this.OnPersonDetailChanging(value);
                this._PersonDetail = value;
                this.OnPersonDetailChanged();
                this.OnPropertyChanged("PersonDetail");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::ODataReadWriteSampleApp.Models.OData.PersonDetail _PersonDetail;
        partial void OnPersonDetailChanging(global::ODataReadWriteSampleApp.Models.OData.PersonDetail value);
        partial void OnPersonDetailChanged();
        /// <summary>
        /// This event is raised when the value of the property is changed
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public event global::System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
        /// <summary>
        /// The value of the property is changed
        /// </summary>
        /// <param name="property">property name</param>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        protected virtual void OnPropertyChanged(string property)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new global::System.ComponentModel.PropertyChangedEventArgs(property));
            }
        }
    }
    /// <summary>
    /// There are no comments for CustomerSingle in the schema.
    /// </summary>
    [global::Microsoft.OData.Client.OriginalNameAttribute("CustomerSingle")]
    public partial class CustomerSingle : global::Microsoft.OData.Client.DataServiceQuerySingle<Customer>
    {
        /// <summary>
        /// Initialize a new CustomerSingle object.
        /// </summary>
        public CustomerSingle(global::Microsoft.OData.Client.DataServiceContext context, string path)
            : base(context, path) {}

        /// <summary>
        /// Initialize a new CustomerSingle object.
        /// </summary>
        public CustomerSingle(global::Microsoft.OData.Client.DataServiceContext context, string path, bool isComposable)
            : base(context, path, isComposable) {}
        /// <summary>
        /// There are no comments for PersonDetail in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public global::ODataReadWriteSampleApp.Models.OData.PersonDetailSingle PersonDetail
        {
            get
            {
                if (!this.IsComposable)
                {
                    throw new global::System.NotSupportedException("The previous function is not composable.");
                }
                if ((this._PersonDetail == null))
                {
                    this._PersonDetail = new global::ODataReadWriteSampleApp.Models.OData.PersonDetailSingle(this.Context, GetPath("PersonDetail"));
                }
                return this._PersonDetail;
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::ODataReadWriteSampleApp.Models.OData.PersonDetailSingle _PersonDetail;
    }
    /// <summary>
    /// There are no comments for Customer in the schema.
    /// </summary>
    /// <KeyProperties>
    /// ID
    /// </KeyProperties>
    [global::Microsoft.OData.Client.Key("ID")]
    [global::Microsoft.OData.Client.OriginalNameAttribute("Customer")]
    public partial class Customer : Person
    {
        /// <summary>
        /// Create a new Customer object.
        /// </summary>
        /// <param name="ID">Initial value of ID.</param>
        /// <param name="totalExpense">Initial value of TotalExpense.</param>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public static Customer CreateCustomer(int ID, decimal totalExpense)
        {
            Customer customer = new Customer();
            customer.ID = ID;
            customer.TotalExpense = totalExpense;
            return customer;
        }
        /// <summary>
        /// There are no comments for Property TotalExpense in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("TotalExpense")]
        public decimal TotalExpense
        {
            get
            {
                return this._TotalExpense;
            }
            set
            {
                this.OnTotalExpenseChanging(value);
                this._TotalExpense = value;
                this.OnTotalExpenseChanged();
                this.OnPropertyChanged("TotalExpense");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private decimal _TotalExpense;
        partial void OnTotalExpenseChanging(decimal value);
        partial void OnTotalExpenseChanged();
    }
    /// <summary>
    /// There are no comments for EmployeeSingle in the schema.
    /// </summary>
    [global::Microsoft.OData.Client.OriginalNameAttribute("EmployeeSingle")]
    public partial class EmployeeSingle : global::Microsoft.OData.Client.DataServiceQuerySingle<Employee>
    {
        /// <summary>
        /// Initialize a new EmployeeSingle object.
        /// </summary>
        public EmployeeSingle(global::Microsoft.OData.Client.DataServiceContext context, string path)
            : base(context, path) {}

        /// <summary>
        /// Initialize a new EmployeeSingle object.
        /// </summary>
        public EmployeeSingle(global::Microsoft.OData.Client.DataServiceContext context, string path, bool isComposable)
            : base(context, path, isComposable) {}
        /// <summary>
        /// There are no comments for PersonDetail in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public global::ODataReadWriteSampleApp.Models.OData.PersonDetailSingle PersonDetail
        {
            get
            {
                if (!this.IsComposable)
                {
                    throw new global::System.NotSupportedException("The previous function is not composable.");
                }
                if ((this._PersonDetail == null))
                {
                    this._PersonDetail = new global::ODataReadWriteSampleApp.Models.OData.PersonDetailSingle(this.Context, GetPath("PersonDetail"));
                }
                return this._PersonDetail;
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::ODataReadWriteSampleApp.Models.OData.PersonDetailSingle _PersonDetail;
    }
    /// <summary>
    /// There are no comments for Employee in the schema.
    /// </summary>
    /// <KeyProperties>
    /// ID
    /// </KeyProperties>
    [global::Microsoft.OData.Client.Key("ID")]
    [global::Microsoft.OData.Client.OriginalNameAttribute("Employee")]
    public partial class Employee : Person
    {
        /// <summary>
        /// Create a new Employee object.
        /// </summary>
        /// <param name="ID">Initial value of ID.</param>
        /// <param name="employeeID">Initial value of EmployeeID.</param>
        /// <param name="hireDate">Initial value of HireDate.</param>
        /// <param name="salary">Initial value of Salary.</param>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public static Employee CreateEmployee(int ID, long employeeID, global::System.DateTimeOffset hireDate, float salary)
        {
            Employee employee = new Employee();
            employee.ID = ID;
            employee.EmployeeID = employeeID;
            employee.HireDate = hireDate;
            employee.Salary = salary;
            return employee;
        }
        /// <summary>
        /// There are no comments for Property EmployeeID in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("EmployeeID")]
        public long EmployeeID
        {
            get
            {
                return this._EmployeeID;
            }
            set
            {
                this.OnEmployeeIDChanging(value);
                this._EmployeeID = value;
                this.OnEmployeeIDChanged();
                this.OnPropertyChanged("EmployeeID");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private long _EmployeeID;
        partial void OnEmployeeIDChanging(long value);
        partial void OnEmployeeIDChanged();
        /// <summary>
        /// There are no comments for Property HireDate in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("HireDate")]
        public global::System.DateTimeOffset HireDate
        {
            get
            {
                return this._HireDate;
            }
            set
            {
                this.OnHireDateChanging(value);
                this._HireDate = value;
                this.OnHireDateChanged();
                this.OnPropertyChanged("HireDate");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::System.DateTimeOffset _HireDate;
        partial void OnHireDateChanging(global::System.DateTimeOffset value);
        partial void OnHireDateChanged();
        /// <summary>
        /// There are no comments for Property Salary in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("Salary")]
        public float Salary
        {
            get
            {
                return this._Salary;
            }
            set
            {
                this.OnSalaryChanging(value);
                this._Salary = value;
                this.OnSalaryChanged();
                this.OnPropertyChanged("Salary");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private float _Salary;
        partial void OnSalaryChanging(float value);
        partial void OnSalaryChanged();
    }
    /// <summary>
    /// There are no comments for PersonDetailSingle in the schema.
    /// </summary>
    [global::Microsoft.OData.Client.OriginalNameAttribute("PersonDetailSingle")]
    public partial class PersonDetailSingle : global::Microsoft.OData.Client.DataServiceQuerySingle<PersonDetail>
    {
        /// <summary>
        /// Initialize a new PersonDetailSingle object.
        /// </summary>
        public PersonDetailSingle(global::Microsoft.OData.Client.DataServiceContext context, string path)
            : base(context, path) {}

        /// <summary>
        /// Initialize a new PersonDetailSingle object.
        /// </summary>
        public PersonDetailSingle(global::Microsoft.OData.Client.DataServiceContext context, string path, bool isComposable)
            : base(context, path, isComposable) {}
        /// <summary>
        /// There are no comments for Person in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public global::ODataReadWriteSampleApp.Models.OData.PersonSingle Person
        {
            get
            {
                if (!this.IsComposable)
                {
                    throw new global::System.NotSupportedException("The previous function is not composable.");
                }
                if ((this._Person == null))
                {
                    this._Person = new global::ODataReadWriteSampleApp.Models.OData.PersonSingle(this.Context, GetPath("Person"));
                }
                return this._Person;
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::ODataReadWriteSampleApp.Models.OData.PersonSingle _Person;
    }
    /// <summary>
    /// There are no comments for PersonDetail in the schema.
    /// </summary>
    /// <KeyProperties>
    /// PersonID
    /// </KeyProperties>
    [global::Microsoft.OData.Client.Key("PersonID")]
    [global::Microsoft.OData.Client.EntitySet("PersonDetails")]
    [global::Microsoft.OData.Client.OriginalNameAttribute("PersonDetail")]
    public partial class PersonDetail : global::Microsoft.OData.Client.BaseEntityType, global::System.ComponentModel.INotifyPropertyChanged
    {
        /// <summary>
        /// Create a new PersonDetail object.
        /// </summary>
        /// <param name="personID">Initial value of PersonID.</param>
        /// <param name="age">Initial value of Age.</param>
        /// <param name="gender">Initial value of Gender.</param>
        /// <param name="photo">Initial value of Photo.</param>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public static PersonDetail CreatePersonDetail(int personID, byte age, bool gender, global::Microsoft.OData.Client.DataServiceStreamLink photo)
        {
            PersonDetail personDetail = new PersonDetail();
            personDetail.PersonID = personID;
            personDetail.Age = age;
            personDetail.Gender = gender;
            personDetail.Photo = photo;
            return personDetail;
        }
        /// <summary>
        /// There are no comments for Property PersonID in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("PersonID")]
        public int PersonID
        {
            get
            {
                return this._PersonID;
            }
            set
            {
                this.OnPersonIDChanging(value);
                this._PersonID = value;
                this.OnPersonIDChanged();
                this.OnPropertyChanged("PersonID");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private int _PersonID;
        partial void OnPersonIDChanging(int value);
        partial void OnPersonIDChanged();
        /// <summary>
        /// There are no comments for Property Age in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("Age")]
        public byte Age
        {
            get
            {
                return this._Age;
            }
            set
            {
                this.OnAgeChanging(value);
                this._Age = value;
                this.OnAgeChanged();
                this.OnPropertyChanged("Age");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private byte _Age;
        partial void OnAgeChanging(byte value);
        partial void OnAgeChanged();
        /// <summary>
        /// There are no comments for Property Gender in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("Gender")]
        public bool Gender
        {
            get
            {
                return this._Gender;
            }
            set
            {
                this.OnGenderChanging(value);
                this._Gender = value;
                this.OnGenderChanged();
                this.OnPropertyChanged("Gender");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private bool _Gender;
        partial void OnGenderChanging(bool value);
        partial void OnGenderChanged();
        /// <summary>
        /// There are no comments for Property Phone in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("Phone")]
        public string Phone
        {
            get
            {
                return this._Phone;
            }
            set
            {
                this.OnPhoneChanging(value);
                this._Phone = value;
                this.OnPhoneChanged();
                this.OnPropertyChanged("Phone");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private string _Phone;
        partial void OnPhoneChanging(string value);
        partial void OnPhoneChanged();
        /// <summary>
        /// There are no comments for Property Address in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("Address")]
        public global::ODataReadWriteSampleApp.Models.OData.Address Address
        {
            get
            {
                return this._Address;
            }
            set
            {
                this.OnAddressChanging(value);
                this._Address = value;
                this.OnAddressChanged();
                this.OnPropertyChanged("Address");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::ODataReadWriteSampleApp.Models.OData.Address _Address;
        partial void OnAddressChanging(global::ODataReadWriteSampleApp.Models.OData.Address value);
        partial void OnAddressChanged();
        /// <summary>
        /// There are no comments for Property Photo in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("Photo")]
        public global::Microsoft.OData.Client.DataServiceStreamLink Photo
        {
            get
            {
                return this._Photo;
            }
            set
            {
                this.OnPhotoChanging(value);
                this._Photo = value;
                this.OnPhotoChanged();
                this.OnPropertyChanged("Photo");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::Microsoft.OData.Client.DataServiceStreamLink _Photo;
        partial void OnPhotoChanging(global::Microsoft.OData.Client.DataServiceStreamLink value);
        partial void OnPhotoChanged();
        /// <summary>
        /// There are no comments for Property Person in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("Person")]
        public global::ODataReadWriteSampleApp.Models.OData.Person Person
        {
            get
            {
                return this._Person;
            }
            set
            {
                this.OnPersonChanging(value);
                this._Person = value;
                this.OnPersonChanged();
                this.OnPropertyChanged("Person");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::ODataReadWriteSampleApp.Models.OData.Person _Person;
        partial void OnPersonChanging(global::ODataReadWriteSampleApp.Models.OData.Person value);
        partial void OnPersonChanged();
        /// <summary>
        /// This event is raised when the value of the property is changed
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public event global::System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
        /// <summary>
        /// The value of the property is changed
        /// </summary>
        /// <param name="property">property name</param>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        protected virtual void OnPropertyChanged(string property)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new global::System.ComponentModel.PropertyChangedEventArgs(property));
            }
        }
    }
    /// <summary>
    /// There are no comments for AdvertisementSingle in the schema.
    /// </summary>
    [global::Microsoft.OData.Client.OriginalNameAttribute("AdvertisementSingle")]
    public partial class AdvertisementSingle : global::Microsoft.OData.Client.DataServiceQuerySingle<Advertisement>
    {
        /// <summary>
        /// Initialize a new AdvertisementSingle object.
        /// </summary>
        public AdvertisementSingle(global::Microsoft.OData.Client.DataServiceContext context, string path)
            : base(context, path) {}

        /// <summary>
        /// Initialize a new AdvertisementSingle object.
        /// </summary>
        public AdvertisementSingle(global::Microsoft.OData.Client.DataServiceContext context, string path, bool isComposable)
            : base(context, path, isComposable) {}
        /// <summary>
        /// There are no comments for FeaturedProduct in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public global::ODataReadWriteSampleApp.Models.OData.FeaturedProductSingle FeaturedProduct
        {
            get
            {
                if (!this.IsComposable)
                {
                    throw new global::System.NotSupportedException("The previous function is not composable.");
                }
                if ((this._FeaturedProduct == null))
                {
                    this._FeaturedProduct = new global::ODataReadWriteSampleApp.Models.OData.FeaturedProductSingle(this.Context, GetPath("FeaturedProduct"));
                }
                return this._FeaturedProduct;
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::ODataReadWriteSampleApp.Models.OData.FeaturedProductSingle _FeaturedProduct;
    }
    /// <summary>
    /// There are no comments for Advertisement in the schema.
    /// </summary>
    /// <KeyProperties>
    /// ID
    /// </KeyProperties>
    [global::Microsoft.OData.Client.Key("ID")]
    [global::Microsoft.OData.Client.EntitySet("Advertisements")]
    [global::Microsoft.OData.Client.HasStream()]
    [global::Microsoft.OData.Client.OriginalNameAttribute("Advertisement")]
    public partial class Advertisement : global::Microsoft.OData.Client.BaseEntityType, global::System.ComponentModel.INotifyPropertyChanged
    {
        /// <summary>
        /// Create a new Advertisement object.
        /// </summary>
        /// <param name="ID">Initial value of ID.</param>
        /// <param name="airDate">Initial value of AirDate.</param>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public static Advertisement CreateAdvertisement(global::System.Guid ID, global::System.DateTimeOffset airDate)
        {
            Advertisement advertisement = new Advertisement();
            advertisement.ID = ID;
            advertisement.AirDate = airDate;
            return advertisement;
        }
        /// <summary>
        /// There are no comments for Property ID in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("ID")]
        public global::System.Guid ID
        {
            get
            {
                return this._ID;
            }
            set
            {
                this.OnIDChanging(value);
                this._ID = value;
                this.OnIDChanged();
                this.OnPropertyChanged("ID");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::System.Guid _ID;
        partial void OnIDChanging(global::System.Guid value);
        partial void OnIDChanged();
        /// <summary>
        /// There are no comments for Property Name in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("Name")]
        public string Name
        {
            get
            {
                return this._Name;
            }
            set
            {
                this.OnNameChanging(value);
                this._Name = value;
                this.OnNameChanged();
                this.OnPropertyChanged("Name");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private string _Name;
        partial void OnNameChanging(string value);
        partial void OnNameChanged();
        /// <summary>
        /// There are no comments for Property AirDate in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("AirDate")]
        public global::System.DateTimeOffset AirDate
        {
            get
            {
                return this._AirDate;
            }
            set
            {
                this.OnAirDateChanging(value);
                this._AirDate = value;
                this.OnAirDateChanged();
                this.OnPropertyChanged("AirDate");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::System.DateTimeOffset _AirDate;
        partial void OnAirDateChanging(global::System.DateTimeOffset value);
        partial void OnAirDateChanged();
        /// <summary>
        /// There are no comments for Property FeaturedProduct in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        [global::Microsoft.OData.Client.OriginalNameAttribute("FeaturedProduct")]
        public global::ODataReadWriteSampleApp.Models.OData.FeaturedProduct FeaturedProduct
        {
            get
            {
                return this._FeaturedProduct;
            }
            set
            {
                this.OnFeaturedProductChanging(value);
                this._FeaturedProduct = value;
                this.OnFeaturedProductChanged();
                this.OnPropertyChanged("FeaturedProduct");
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        private global::ODataReadWriteSampleApp.Models.OData.FeaturedProduct _FeaturedProduct;
        partial void OnFeaturedProductChanging(global::ODataReadWriteSampleApp.Models.OData.FeaturedProduct value);
        partial void OnFeaturedProductChanged();
        /// <summary>
        /// This event is raised when the value of the property is changed
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        public event global::System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
        /// <summary>
        /// The value of the property is changed
        /// </summary>
        /// <param name="property">property name</param>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.0.0")]
        protected virtual void OnPropertyChanged(string property)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new global::System.ComponentModel.PropertyChangedEventArgs(property));
            }
        }
    }
    /// <summary>
    /// Class containing all extension methods
    /// </summary>
    public static class ExtensionMethods
    {
        /// <summary>
        /// Get an entity of type global::ODataReadWriteSampleApp.Models.OData.Product as global::ODataReadWriteSampleApp.Models.OData.ProductSingle specified by key from an entity set
        /// </summary>
        /// <param name="source">source entity set</param>
        /// <param name="keys">dictionary with the names and values of keys</param>
        public static global::ODataReadWriteSampleApp.Models.OData.ProductSingle ByKey(this global::Microsoft.OData.Client.DataServiceQuery<global::ODataReadWriteSampleApp.Models.OData.Product> source, global::System.Collections.Generic.Dictionary<string, object> keys)
        {
            return new global::ODataReadWriteSampleApp.Models.OData.ProductSingle(source.Context, source.GetKeyPath(global::Microsoft.OData.Client.Serializer.GetKeyString(source.Context, keys)));
        }
        /// <summary>
        /// Get an entity of type global::ODataReadWriteSampleApp.Models.OData.FeaturedProduct as global::ODataReadWriteSampleApp.Models.OData.FeaturedProductSingle specified by key from an entity set
        /// </summary>
        /// <param name="source">source entity set</param>
        /// <param name="keys">dictionary with the names and values of keys</param>
        public static global::ODataReadWriteSampleApp.Models.OData.FeaturedProductSingle ByKey(this global::Microsoft.OData.Client.DataServiceQuery<global::ODataReadWriteSampleApp.Models.OData.FeaturedProduct> source, global::System.Collections.Generic.Dictionary<string, object> keys)
        {
            return new global::ODataReadWriteSampleApp.Models.OData.FeaturedProductSingle(source.Context, source.GetKeyPath(global::Microsoft.OData.Client.Serializer.GetKeyString(source.Context, keys)));
        }
        /// <summary>
        /// Cast an entity of type global::ODataReadWriteSampleApp.Models.OData.Product to its derived type global::ODataReadWriteSampleApp.Models.OData.FeaturedProduct
        /// </summary>
        /// <param name="source">source entity</param>
        public static global::ODataReadWriteSampleApp.Models.OData.FeaturedProductSingle CastToFeaturedProduct(this global::Microsoft.OData.Client.DataServiceQuerySingle<global::ODataReadWriteSampleApp.Models.OData.Product> source)
        {
            global::Microsoft.OData.Client.DataServiceQuerySingle<global::ODataReadWriteSampleApp.Models.OData.FeaturedProduct> query = source.CastTo<global::ODataReadWriteSampleApp.Models.OData.FeaturedProduct>();
            return new global::ODataReadWriteSampleApp.Models.OData.FeaturedProductSingle(source.Context, query.GetPath(null));
        }
        /// <summary>
        /// Get an entity of type global::ODataReadWriteSampleApp.Models.OData.ProductDetail as global::ODataReadWriteSampleApp.Models.OData.ProductDetailSingle specified by key from an entity set
        /// </summary>
        /// <param name="source">source entity set</param>
        /// <param name="keys">dictionary with the names and values of keys</param>
        public static global::ODataReadWriteSampleApp.Models.OData.ProductDetailSingle ByKey(this global::Microsoft.OData.Client.DataServiceQuery<global::ODataReadWriteSampleApp.Models.OData.ProductDetail> source, global::System.Collections.Generic.Dictionary<string, object> keys)
        {
            return new global::ODataReadWriteSampleApp.Models.OData.ProductDetailSingle(source.Context, source.GetKeyPath(global::Microsoft.OData.Client.Serializer.GetKeyString(source.Context, keys)));
        }
        /// <summary>
        /// Get an entity of type global::ODataReadWriteSampleApp.Models.OData.Category as global::ODataReadWriteSampleApp.Models.OData.CategorySingle specified by key from an entity set
        /// </summary>
        /// <param name="source">source entity set</param>
        /// <param name="keys">dictionary with the names and values of keys</param>
        public static global::ODataReadWriteSampleApp.Models.OData.CategorySingle ByKey(this global::Microsoft.OData.Client.DataServiceQuery<global::ODataReadWriteSampleApp.Models.OData.Category> source, global::System.Collections.Generic.Dictionary<string, object> keys)
        {
            return new global::ODataReadWriteSampleApp.Models.OData.CategorySingle(source.Context, source.GetKeyPath(global::Microsoft.OData.Client.Serializer.GetKeyString(source.Context, keys)));
        }
        /// <summary>
        /// Get an entity of type global::ODataReadWriteSampleApp.Models.OData.Supplier as global::ODataReadWriteSampleApp.Models.OData.SupplierSingle specified by key from an entity set
        /// </summary>
        /// <param name="source">source entity set</param>
        /// <param name="keys">dictionary with the names and values of keys</param>
        public static global::ODataReadWriteSampleApp.Models.OData.SupplierSingle ByKey(this global::Microsoft.OData.Client.DataServiceQuery<global::ODataReadWriteSampleApp.Models.OData.Supplier> source, global::System.Collections.Generic.Dictionary<string, object> keys)
        {
            return new global::ODataReadWriteSampleApp.Models.OData.SupplierSingle(source.Context, source.GetKeyPath(global::Microsoft.OData.Client.Serializer.GetKeyString(source.Context, keys)));
        }
        /// <summary>
        /// Get an entity of type global::ODataReadWriteSampleApp.Models.OData.Person as global::ODataReadWriteSampleApp.Models.OData.PersonSingle specified by key from an entity set
        /// </summary>
        /// <param name="source">source entity set</param>
        /// <param name="keys">dictionary with the names and values of keys</param>
        public static global::ODataReadWriteSampleApp.Models.OData.PersonSingle ByKey(this global::Microsoft.OData.Client.DataServiceQuery<global::ODataReadWriteSampleApp.Models.OData.Person> source, global::System.Collections.Generic.Dictionary<string, object> keys)
        {
            return new global::ODataReadWriteSampleApp.Models.OData.PersonSingle(source.Context, source.GetKeyPath(global::Microsoft.OData.Client.Serializer.GetKeyString(source.Context, keys)));
        }
        /// <summary>
        /// Get an entity of type global::ODataReadWriteSampleApp.Models.OData.Customer as global::ODataReadWriteSampleApp.Models.OData.CustomerSingle specified by key from an entity set
        /// </summary>
        /// <param name="source">source entity set</param>
        /// <param name="keys">dictionary with the names and values of keys</param>
        public static global::ODataReadWriteSampleApp.Models.OData.CustomerSingle ByKey(this global::Microsoft.OData.Client.DataServiceQuery<global::ODataReadWriteSampleApp.Models.OData.Customer> source, global::System.Collections.Generic.Dictionary<string, object> keys)
        {
            return new global::ODataReadWriteSampleApp.Models.OData.CustomerSingle(source.Context, source.GetKeyPath(global::Microsoft.OData.Client.Serializer.GetKeyString(source.Context, keys)));
        }
        /// <summary>
        /// Cast an entity of type global::ODataReadWriteSampleApp.Models.OData.Person to its derived type global::ODataReadWriteSampleApp.Models.OData.Customer
        /// </summary>
        /// <param name="source">source entity</param>
        public static global::ODataReadWriteSampleApp.Models.OData.CustomerSingle CastToCustomer(this global::Microsoft.OData.Client.DataServiceQuerySingle<global::ODataReadWriteSampleApp.Models.OData.Person> source)
        {
            global::Microsoft.OData.Client.DataServiceQuerySingle<global::ODataReadWriteSampleApp.Models.OData.Customer> query = source.CastTo<global::ODataReadWriteSampleApp.Models.OData.Customer>();
            return new global::ODataReadWriteSampleApp.Models.OData.CustomerSingle(source.Context, query.GetPath(null));
        }
        /// <summary>
        /// Get an entity of type global::ODataReadWriteSampleApp.Models.OData.Employee as global::ODataReadWriteSampleApp.Models.OData.EmployeeSingle specified by key from an entity set
        /// </summary>
        /// <param name="source">source entity set</param>
        /// <param name="keys">dictionary with the names and values of keys</param>
        public static global::ODataReadWriteSampleApp.Models.OData.EmployeeSingle ByKey(this global::Microsoft.OData.Client.DataServiceQuery<global::ODataReadWriteSampleApp.Models.OData.Employee> source, global::System.Collections.Generic.Dictionary<string, object> keys)
        {
            return new global::ODataReadWriteSampleApp.Models.OData.EmployeeSingle(source.Context, source.GetKeyPath(global::Microsoft.OData.Client.Serializer.GetKeyString(source.Context, keys)));
        }
        /// <summary>
        /// Cast an entity of type global::ODataReadWriteSampleApp.Models.OData.Person to its derived type global::ODataReadWriteSampleApp.Models.OData.Employee
        /// </summary>
        /// <param name="source">source entity</param>
        public static global::ODataReadWriteSampleApp.Models.OData.EmployeeSingle CastToEmployee(this global::Microsoft.OData.Client.DataServiceQuerySingle<global::ODataReadWriteSampleApp.Models.OData.Person> source)
        {
            global::Microsoft.OData.Client.DataServiceQuerySingle<global::ODataReadWriteSampleApp.Models.OData.Employee> query = source.CastTo<global::ODataReadWriteSampleApp.Models.OData.Employee>();
            return new global::ODataReadWriteSampleApp.Models.OData.EmployeeSingle(source.Context, query.GetPath(null));
        }
        /// <summary>
        /// Get an entity of type global::ODataReadWriteSampleApp.Models.OData.PersonDetail as global::ODataReadWriteSampleApp.Models.OData.PersonDetailSingle specified by key from an entity set
        /// </summary>
        /// <param name="source">source entity set</param>
        /// <param name="keys">dictionary with the names and values of keys</param>
        public static global::ODataReadWriteSampleApp.Models.OData.PersonDetailSingle ByKey(this global::Microsoft.OData.Client.DataServiceQuery<global::ODataReadWriteSampleApp.Models.OData.PersonDetail> source, global::System.Collections.Generic.Dictionary<string, object> keys)
        {
            return new global::ODataReadWriteSampleApp.Models.OData.PersonDetailSingle(source.Context, source.GetKeyPath(global::Microsoft.OData.Client.Serializer.GetKeyString(source.Context, keys)));
        }
        /// <summary>
        /// Get an entity of type global::ODataReadWriteSampleApp.Models.OData.Advertisement as global::ODataReadWriteSampleApp.Models.OData.AdvertisementSingle specified by key from an entity set
        /// </summary>
        /// <param name="source">source entity set</param>
        /// <param name="keys">dictionary with the names and values of keys</param>
        public static global::ODataReadWriteSampleApp.Models.OData.AdvertisementSingle ByKey(this global::Microsoft.OData.Client.DataServiceQuery<global::ODataReadWriteSampleApp.Models.OData.Advertisement> source, global::System.Collections.Generic.Dictionary<string, object> keys)
        {
            return new global::ODataReadWriteSampleApp.Models.OData.AdvertisementSingle(source.Context, source.GetKeyPath(global::Microsoft.OData.Client.Serializer.GetKeyString(source.Context, keys)));
        }
        /// <summary>
        /// There are no comments for Discount in the schema.
        /// </summary>
        public static global::Microsoft.OData.Client.DataServiceActionQuerySingle<double> Discount(this global::Microsoft.OData.Client.DataServiceQuerySingle<global::ODataReadWriteSampleApp.Models.OData.Product> source, int discountPercentage)
        {
            if (!source.IsComposable)
            {
                throw new global::System.NotSupportedException("The previous function is not composable.");
            }

            return new global::Microsoft.OData.Client.DataServiceActionQuerySingle<double>(source.Context, source.AppendRequestUri("ODataDemo.Discount"), new global::Microsoft.OData.Client.BodyOperationParameter("discountPercentage", discountPercentage));
        }
    }
}