{"id":48050728,"url":"https://github.com/moh-hassan/odata2poco","last_synced_at":"2026-04-04T14:21:30.934Z","repository":{"id":41361307,"uuid":"50731317","full_name":"moh-hassan/odata2poco","owner":"moh-hassan","description":"generate POCO classes from OData service","archived":false,"fork":false,"pushed_at":"2025-08-24T19:06:51.000Z","size":12060,"stargazers_count":65,"open_issues_count":1,"forks_count":22,"subscribers_count":5,"default_branch":"master","last_synced_at":"2026-03-28T02:03:18.802Z","etag":null,"topics":["code-generation","csharp","dto","dynamics-365","linux","metadata","netcore","oauth2","odata","poco","typescript","webapi"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moh-hassan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-01-30T15:46:16.000Z","updated_at":"2025-12-07T11:08:42.000Z","dependencies_parsed_at":"2023-12-09T12:22:42.628Z","dependency_job_id":"92de1212-fb53-4be1-8439-7c77fafe0682","html_url":"https://github.com/moh-hassan/odata2poco","commit_stats":{"total_commits":157,"total_committers":9,"mean_commits":"17.444444444444443","dds":0.07006369426751591,"last_synced_commit":"12512be3dcd0b8ed7c00b95cdebac8355bc3832b"},"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"purl":"pkg:github/moh-hassan/odata2poco","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moh-hassan%2Fodata2poco","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moh-hassan%2Fodata2poco/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moh-hassan%2Fodata2poco/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moh-hassan%2Fodata2poco/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moh-hassan","download_url":"https://codeload.github.com/moh-hassan/odata2poco/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moh-hassan%2Fodata2poco/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31402349,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-generation","csharp","dto","dynamics-365","linux","metadata","netcore","oauth2","odata","poco","typescript","webapi"],"created_at":"2026-04-04T14:21:30.537Z","updated_at":"2026-04-04T14:21:30.914Z","avatar_url":"https://github.com/moh-hassan.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Welcome to OData2Poco\n**OData2Poco** is a code generation tool for generating plain-old CLR objects (POCO/DTO) in c# and typescript from OData feeds. \nPOCO classes can be used in a typed RESTful client OData services. Code generation can be controlled by setting many options.\n\n----------\n## OData2Poco 6.4.0 is now available!\nThe version v6.4.0 is released on April 1,2025 and it is now available in nuget! The new major enhancement are:\n- New Feature: Avoid generating code when there is no change in the metadata since last generation (#52).\n- New Feature: Add new option ```login``` which support Cookie-Based Authentication (Session-Based Authentication). The new feature help SAP users for login to Cookie-Based Authentication Odata service.\n\nRead how to use the [new features](https://github.com/moh-hassan/odata2poco/wiki/v6_4_0)\n\n-----\n\n[![NuGet Version](https://img.shields.io/nuget/v/OData2Poco.CommandLine.svg?label=nuget%20ClassLibrary\u0026style=flat)](https://www.nuget.org/packages/OData2Poco) \u003c/p\u003e\n[![NuGet Version](https://img.shields.io/nuget/v/OData2Poco.CommandLine.svg?label=nuget%20Console\u0026style=flat)](https://www.nuget.org/packages/OData2Poco.CommandLine) \u003c/p\u003e\n[![Global Tool NuGet Version](https://img.shields.io/nuget/v/OData2Poco.dotnet.o2pgen.svg?label=dotnet%20Global%20Tool\u0026style=flat)](https://www.nuget.org/packages/OData2Poco.dotnet.o2pgen) \u003c/p\u003e\n[![Chocolatey](https://img.shields.io/chocolatey/v/odata2poco-commandline.svg?label=Chocolatey%20Console)](https://chocolatey.org/packages/odata2poco-commandline)\n\n## Continuous integration\n|Branch    |Build status   |\n|----------|---------------|\n|Master    |[![Build status](https://ci.appveyor.com/api/projects/status/sjaqqu70ex31n8se?svg=true)](https://ci.appveyor.com/project/moh-hassan/odata2poco/branch/master)|\n|Develop    |[![Build status](https://ci.appveyor.com/api/projects/status/sjaqqu70ex31n8se?svg=true)](https://ci.appveyor.com/project/moh-hassan/odata2poco/branch/develop)|\n-----------\n\n## Development packages\nThe developed packages can be downloaded from `myget.org`\n\n- [OData2Poco](https://www.myget.org/feed/odata2poco/package/nuget/OData2Poco)\n- [OData2Poco.CommandLine](https://www.myget.org/feed/odata2poco/package/nuget/OData2Poco.CommandLine)\n- [OData2Poco.dotnet.o2pgen](https://www.myget.org/feed/odata2poco/package/nuget/OData2Poco.dotnet.o2pgen)\n--------- \n\n## Give a Star! :star:\n\nIf you are using this project, please show your support by giving this project a star!. Thanks!\n\n-----------\n**Features of OData2Poco**\n   \n- Generate POCO classes corresponding to the Entities defined in the XML MetaData stored in OData Feeds. \n- Generate c# code classes, classes with init-only properties of c#8 and records.\n- Generate typescript code as a single file or multi files(modules).\n- Generation is based on the Metadata of the service stored on the  server/  EDMX xml files or xml string contents.\n- Support http(s) with different methods of authentication. The Supported autherizations are: Basic,Bearer,token,Ntlm,Digest, Custom and Oauth2.\n- Console CommandLine tool Support .NET472 or higher.\n- Class library Support NET6/netstandard2.0/net461.\n- Support Windows or Linux /OS fx (with mono installed) and NET6 (netcore).\n- Packaged as a nuget package in three different packages:\n -  A Class library full framework/ netstandard2.0 /NET5 for programming.\n - A console CommandLine tool (one executable file o2pgen.exe)\n -  Global net core support NET6 (dotnet-o2pgen).\n -  Console tool o2pgen is published as a Chocolatey package. \n- Generating CSharp POCO classes. Other languages may be added in the near future based on the community needs.\n- Convert Data type of EDMX to the corresponding CLR data types.\n- Support Entites, complex data type, Collections  and navigation properties.\n- Support OData service version V1..V4\n- Code generation is controlled by setting different options: \n  - User defined Atributes for the classes and properties using simple text file with c# Expressions.\n  - Built-in Attributes:\n        - Add Key Attributes.\n        - Add Required Attributes to the properties. \n        - Add JsonProperty Attribute to the properties.\n        - Add Table Attribute to the class.\n        - Add DataMember Attribute to the properties and DataContract Attribute to the class.\n        - Add display attribute to the properties.\n        - Add ProtoMember to the properties and ProtoContract to the class to suport Proto Buffer.\n        - Add user defined attribute for the properties.\n        \n   - Adding virtual modifier to the properties.\n   - Convert name of properties to camelCase or PasCase\n   - Add nullable datatypes, e.g. int?.\n   - Generate (or not) navigation properties.\n   - Generated class follows inheritance hierarchy of OData feed (unless switched-off).\n   - Generated class can inherit from a common BaseClass/interface.\n   - Define namespace to overwrite the namespace of the model.\n   - Filter Entities.\n   - Name Mapping  of Entities and properties using json file with regex support.\n- Add primary key/mandatory comments to the properties of the class. \n- Rename class/properties that have a name match a c# reserved keyword.  \n- Save metadata and generated code to a user defined file name.\n- Support colored console windows /linux /OS fx.\n- Support Microsoft.OData.Edm library version 7.5+ (OData v4).\n- Support Microsoft.Data.Edm library (OData v1-v3).\n\n **Features added in V3.2.0:** \n\n- New: Support Windows NTLM authentication(Thanks to @lobster2012-user for help). \n- New: Support Microsoft Digest authentication.\n- New: Support Integrated Windows Authentication, enabling users to log in with their Windows credentials (Issue#19).\n- New: Add jsonProperty(originalName) to properties that are renamed because its name is the same as its enclosing type.\n- New: Show/hide model warning due to renaming properties/classes whose name is a reserved  keyword.\n- New: Support abstract class.\n- New: support complex type inheritance\n- New: Add attribute [MaxLength] for max length of string/byte[] properties.\n- Convert EDM.TIME in Odata v3 to TimeSpan.\n- Support multi schema.\n- Support multi containers in OData  v3.\n- New feature in [v5.0.1](https://github.com/moh-hassan/odata2poco/wiki/v5_0_1)\n- New feature in [v6.0](https://github.com/moh-hassan/odata2poco/wiki/v6_0_0).\n\n -------------\n ## OData2Poco Packages\nOData2Poco is available in three flavers:\n- A class library: support NET6/netstandard2.0/net461,[download](https://www.nuget.org/packages/OData2Poco).\n- A Console tool: OData2Poco.CommandLine support net472 (a.k.a o2pgen), [download](https://www.nuget.org/packages/OData2Poco.CommandLine).\n- A .Net Core Global tool  `dotnet-o2pgen` support NET6, [download](https://www.nuget.org/packages/OData2Poco.dotnet.o2pgen).\n- Checolatey Console tool, [download](https://community.chocolatey.org/packages/odata2poco-commandline).\n\n----------\n\n## Install and Usage\n\n## 1) OData2Poco.CommandLine o2pgen Console Cli\n\nOData2Poco.CommandLine is a Console application (net472) named o2pgen.\n\nIt Can be installed from [Nuget Gallery](https://www.nuget.org/packages/OData2Poco.CommandLine):\n\n       Install-Package OData2Poco.CommandLine \n\n\n### Executing o2pgen as MsBuild Target\n\nAdd the next xml code to the project.csproj:\n\n```xml\n\u003cTarget Name=\"Odata2PocoRun\" BeforeTargets=\"CoreCompile\"\u003e\n         \u003cPropertyGroup\u003e\n\t\t\t\u003cEnableCodeGeneration\u003etrue\u003c/EnableCodeGeneration\u003e\n               \u003co2pgen\u003e$(PkgOData2Poco_CommandLine)\\tools\\o2pgen.exe\u003c/o2pgen\u003e\n               \u003coptions\u003e-r http://services.odata.org/V4/Northwind/Northwind.svc/ -f Model\\north.cs\u003c/options\u003e\n\t\t\u003c/PropertyGroup\u003e\n\t\t\u003cMessage Text=\"Executing o2pgen.exe\" Importance=\"High\" /\u003e\n\t\t\u003cExec Condition=\"$(EnableCodeGeneration)\n             Command=\"$(o2pgen)  $(options)\" /\u003e\n\u003c/Target\u003e\n```\n\nThe attribute `Options` is the commandLine arguments. Modify the commandline options as you want.\nFor more details read [Getting Start](https://github.com/moh-hassan/odata2poco/wiki/getting-start).\n\n### Excuting o2pgen from Package Console Manager (PCM):\nIn visual studio 2019 and higher, o2pgen can be run directly from PowerShell Console (PCM). Its path is set during installation.\n\nCheck application is installed:\n```\nPM\u003e o2pgen --version\n```\n### Linux and Mac/OS x support\nO2pgen cli can run on Linux and Mac/OS if Mono is installed.\n\n-------------\n## 2) OData2Poco global Console Cli (net6.0)\n\n Install from nuget gallary, run the command:\n```\ndotnet tool install --global OData2Poco.dotnet.o2pgen\n```\n### How to use:\nRun the command:\n\n       dotnet o2pgen -r http://services.odata.org/V4/Northwind/Northwind.svc/\n\t   \nFor help type: `dotnet o2pgen --help`\n\nReview [Commandline option](https://github.com/moh-hassan/odata2poco/wiki/CommandLine-Reference).\n ### Executing the global tool as Msbuild Target\n\n You can auto run `dotnet o2pgen` from within MsBuild Target and save code in the project folder.\n\n Add the next Msbuild target to your project and modify command parameters as needed.\n When the property `EnableCodeGeneration` is set to `false`, no code is generated.\n The generated code is saved to file `northwind.cs` in the folder Model in the root of the project.\n\n ```xml\n\u003cTarget Name=\"GenerateCode\" BeforeTargets=\"CoreCompile\"\u003e\n\t\t\u003cPropertyGroup\u003e\n\t\t\t\u003cEnableCodeGeneration\u003etrue\u003c/EnableCodeGeneration\u003e\n\t\t\u003c/PropertyGroup\u003e\n\t\t\u003cExec  Condition=\"$(EnableCodeGeneration)\"\n\t\t  Command=\"dotnet o2pgen -r http://services.odata.org/V4/Northwind/Northwind.svc/ -f $(MSBuildProjectDirectory)\\Model\\northwind.cs -B\"\u003e\n\t\t\u003c/Exec\u003e\n\t\u003c/Target\u003e\n ```         \n \n## 3) OData2Poco Class library\n\nSupport NET6/netstandard2.0/net461.\nIt can be installed from [Nuget Gallery](https://www.nuget.org/packages/OData2Poco/)\n\n         Install-Package OData2Poco\n\nTry demo Application in NET6 [Online](https://dotnetfiddle.net/LSSwIS)\n\n\n-------\n## 4) Checolatey Package\n \nFrom [Chocolatey Gallery](https://chocolatey.org/packages/odata2poco-commandline):\n\n     choco install odata2poco-commandline\n\n------\n ## Documentation\n\nRead the:[Wiki](https://github.com/moh-hassan/odata2poco/wiki)\n\n-------\n**License**\n\nMIT License.\n\n----------\n## Release Notes\n\n[Changes](https://github.com/moh-hassan/odata2poco/blob/master/ReleaseNotes.md)\n\n## Privacy Policy\nAll programs or packages will not transfer any information to other networked systems unless specifically requested by the user or the person installing or operating it. \n\n## Code Signing Policy\nThis project uses free code signing provided by [SignPath.io](https://signpath.io?utm_source=foundation\u0026utm_medium=github\u0026utm_campaign=odata2poco), and a certificate by the [SignPath Foundation](https://signpath.org?utm_source=foundation\u0026utm_medium=github\u0026utm_campaign=odata2poco).\n\nStarting with v6.2, o2pgen.exe and all odata2poco.xxx.nupkg packages are signed. Code signing is applied only to odata2poco project code in the [odata2poco repository](https://github.com/moh-hassan/odata2poco) master branch and built on AppVeyor.  The odata2poco.xxx.nupkg packages contain third-party libraries used by odata2poco, which may or may not be signed.  \n\n## Acknowledgements: \n\n**Thank you [SignPath](https://signpath.io?utm_source=foundation\u0026utm_medium=github\u0026utm_campaign=odata2poco) for free code signing.**\n\n\u003cimg src=\"art/signpath.jpg\" alt=\"signpath\" width=\"200\"/\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoh-hassan%2Fodata2poco","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoh-hassan%2Fodata2poco","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoh-hassan%2Fodata2poco/lists"}