Giter Club home page Giter Club logo

odata2poco's Introduction

Welcome to OData2Poco

OData2Poco is a code generation tool for generating plain-old CLR objects (POCO) from OData feeds. POCO classes can be used in a typed RESTful client OData services and code generation can be controlled by setting many options.

OData2Poco is available in two flavers:

A CLI tool: OData2Poco.CommandLine (a.k.a o2pgen).

A class library: with T4 template.

Nuget: NuGet Chocolatey: Chocolatey

Continuous integration

Build server Platform Build status
AppVeyor Windows Build status
Travis Linux / OS X Build Status

What's news?

  • Dec 21,2017 Add inheritance support by default, v2.3.0. Thanks to merijndejonge.

    Generated class follows inhertance hierarchy of OData feed (unless switched-off by -i option)

Now, Odata2Poco.CommandLine is available in chocolatey Gallery.

To install run the command:

     choco install odata2poco-commandline 

Features of OData2Poco

  • Generate POCO classes corresponding to the Entities defined in the XML MetaData stored in OData Feeds. *

  • Generation is based on the Metadata of the service stored on the server/ or EDMX xml files.

  • Support http(s) with/without basic authentication : user and password.

  • Convert Data type of EDMX to the corresponding CLR data types.

  • Support Entites, complex data type, Collections and navigation properties.

  • Support OData service version V1..V4

  • Code generation is controlled by setting different options:

    • Add Key, Required Attributes to the properties.
    • Add JsonProperty Attribute to the properties.
    • Add Table Attribute to the class.
    • Adding virtual modifier to the properties.
    • Convert name of properties to camelCase or PasCase
    • Add nullable datatypes, e.g. int?.
    • Generate (or not) navigation properties.
    • Generated class follows inhertance hierarchy of OData feed (unless switched-off).
    • Generated class can inherit from a common BaseClass/interface.
    • Define namespace to overwrite the namespace of the model.
  • Add primary key/mandatory comments to the properties of the class. .

  • Save metadata and generated code to a user defined file name.

  • Support .NET 4.5 or higher

  • Support Windows or Linux (Mono)

  • Packaged as a Class library and CommandLine tool (one executable file o2pgen.exe) and can be installed from nuget web site.

  • Generating CSharp POCO classes. Other languages may be supported in the near future based on the community needs.

  • MIT License.

Install

OData2Poco.CommandLine (o2pgen) console application:

From Nuget Gallery:

From Chocolatey Gallery:

 choco install odata2poco-commandline

OData2Poco Class library:

From Nuget Gallery enter image description here

.NET Requirements

OData2Poco requires .Net 4.5 or higher.

Dependency of Odata2Poco Class Library

Microsoft.Data.Edm version="5.7.0" or higher

Microsoft.OData.Edm version="6.15.0" or higher

Note: The generated POCO classes code need not these EDM dependency libraries when POCO is used in your project.

Release Notes

  • v 2.2.1 March 21, 2017 (last release)
  • v 2.2.0 March 11, 2017
  • v 2.1.0 February 28, 2017
  • v 2.0.0 June 27, 2016
  • v 1.3.0 April 10, 2016

Latest Changes

v2.2.1: Support Nullable Data type: DateTime (issue #3), DateTimeOffset, TimeSpan, Guid.

All Changes

Try it:

   o2pgen -r http://services.odata.org/V4/Northwind/Northwind.svc/

How to use

Read the documentation:Wiki

Acknowledgements:

Thank you JetBrains for Resharper open source license

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.