Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for read-only attributes from *.edmx #27

Closed
dawiehyman opened this issue Oct 6, 2019 · 2 comments
Closed

Support for read-only attributes from *.edmx #27

dawiehyman opened this issue Oct 6, 2019 · 2 comments

Comments

@dawiehyman
Copy link

dawiehyman commented Oct 6, 2019

I am attempting to create a poco from Microsoft Business Central, which is admittedly ODataV4 . I am getting desperately close, except that some properties of entities in the Metadata is marked as read-only, but it comes into the generated poco with {get; set;} modifiers. Is there a switch I am missing, or is this currently not supported?

@moh-hassan
Copy link
Owner

Welcome @dawiehyman to Odata2Poco project
Can you show me sample of the xml schema of Odata v4 service that support readonly properties?
You mean the generated property could be:

         public string  Name {get;}   //rather than {get;set;}

@moh-hassan
Copy link
Owner

A new package v3.3.0 is released that fix your issue.

The new features:

You can download:

Try the commandline

o2pgen -r http://services.odata.org/V4/TripPinServiceRW -v 

You find the class with ReadOnly properties has get only.

public partial class Airline
	{
	    public string AirlineCode {get;} //PrimaryKey not null ReadOnly
	    public string Name {get;set;} // not null
	}

Let me know if that version fixes your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants