Sample of Generated code

for OData feed: http://services.odata.org/V4/OData/OData.svc

using System;
using System.Collections.Generic;
//uncomment for spatial data type and run Install-Package System.Spatial
//using System.Spatial;

//------------------------------------------------------------------------------

// <auto-generated>
//     This code was generated using  OData2Poco Class library.
//     Service Url: http://services.odata.org/V4/OData/OData.svc
//     MetaData Version: 4.0
// </auto-generated>
//------------------------------------------------------------------------------

namespace ODataDemo
{
    public class Product
    {
                public int ID {get;set;}  //PrimaryKey not null
                public string Name {get;set;}
                public string Description {get;set;}
                public DateTimeOffset ReleaseDate {get;set;}  // not null
                public DateTimeOffset DiscontinuedDate {get;set;}
                public short Rating {get;set;}  // not null
                public double Price {get;set;}  // not null
    }

    public class FeaturedProduct
    {
                public int ID {get;set;}  // not null
                public string Name {get;set;}
                public string Description {get;set;}
                public DateTimeOffset ReleaseDate {get;set;}  // not null
                public DateTimeOffset DiscontinuedDate {get;set;}
                public short Rating {get;set;}  // not null
                public double Price {get;set;}  // not null
                public List<Category> Categories {get;set;}
                public Supplier Supplier {get;set;}
                public ProductDetail ProductDetail {get;set;}
    }

    public class ProductDetail
    {
                public int ProductID {get;set;}  //PrimaryKey not null
                public string Details {get;set;}
    }

    public class Category
    {
                public int ID {get;set;}  //PrimaryKey not null
                public string Name {get;set;}
    }

    public class Supplier
    {
                public int ID {get;set;}  //PrimaryKey not null
                public string Name {get;set;}
                public Address Address {get;set;}
                public GeographyPoint Location {get;set;}
                public int Concurrency {get;set;}  // not null
    }

    public class Address
    {
                public string Street {get;set;}
                public string City {get;set;}
                public string State {get;set;}
                public string ZipCode {get;set;}
                public string Country {get;set;}
    }

    public class Person
    {
                public int ID {get;set;}  //PrimaryKey not null
                public string Name {get;set;}
    }

    public class Customer
    {
                public int ID {get;set;}  // not null
                public string Name {get;set;}
                public PersonDetail PersonDetail {get;set;}
                public decimal TotalExpense {get;set;}  // not null
    }

    public class Employee
    {
                public int ID {get;set;}  // not null
                public string Name {get;set;}
                public PersonDetail PersonDetail {get;set;}
                public long EmployeeID {get;set;}  // not null
                public DateTimeOffset HireDate {get;set;}  // not null
                public float Salary {get;set;}  // not null
    }

    public class PersonDetail
    {
                public int PersonID {get;set;}  //PrimaryKey not null
                public byte Age {get;set;}  // not null
                public bool Gender {get;set;}  // not null
                public string Phone {get;set;}
                public Address Address {get;set;}
                public Stream Photo {get;set;}  // not null
    }

    public class Advertisement
    {
                public Guid ID {get;set;}  //PrimaryKey not null
                public string Name {get;set;}
                public DateTimeOffset AirDate {get;set;}  // not null
    }

}

 

Last edited May 4, 2016 at 1:39 PM by mohamed_hassan, version 1