Comments (10)
Can I know what the info you need?
It may be available in the API, so you can use it.
from odata2poco.
Thanks for your help!
Right now I just want to get entity names, entity elements and data types like you are doing for POCO class.
Here I'm getting the entity name but I can get the element names and their data types though I see in the debugger where they are in the image below. The debugger image shows the path to the element data types starting with "entity.Type.ElementType" but Intellisense shows "ElementType" is not an option though I see it in the debugger image.
from odata2poco.
You can get the metadata as given below:
var o2p = new O2P(setting);
var code = await o2p.GenerateAsync(connString);
//generate metadata as xml file
string metaData = o2p.MetaDataAsString;
from odata2poco.
Perfect! Is there an easy way to get into an object to iterate?
I'm running the demo and getting these errors which I didn't get last time?
from odata2poco.
These aren't errors, but log messages because the EntityName/ propertyName is a reserved c# keyword or the name of the property is the same name as its class type which causes the compiler error CS0542
e.g.,the message:
Rename the property 'Applicant.Applicant' to 'applicant' for avoiding the Compiler error CS0542
The message means that the property 'Applicant' in the class 'Applicant' is renamed to 'applicant' (lowercase) to avoid the compilation error CS0542
O2pgen rename the entity/property and show these messages during the generation, so you can avoid the compilation errors you get in your issue #12.
These information are very important when you retrieve data from Odata feeds using the generated POCO with Odata client tools and it's better to save these log messages.
In the next release, I can control show/hide these messages by an option or saving to log file.
from odata2poco.
Hi @darinvanatta
You can download a new version 3.2.0 from github
- The warning are hided with the option
--show-warning
to show. - All renamed properties have an attribute
JsonProperty
, because Odata is case sensitive for the name of the properties/classes otherwise you get null values for these properties, example:
[JsonProperty("Applicant")]
public virtual string applicant {get;set;}
Try to reterive Applicant
Entity and be sure that applicant
property is not null.
I appreciate your feedback
from odata2poco.
Looks good! Thanks
from odata2poco.
Thanks @darinvanatta for feedback.
I suggest you generate a separate class library for the POCO classes and reference it in your project.
You can benefit from Linq and reflection and utilize the code as your needs.
from odata2poco.
Reflection on a class library works exactly as I need... Thanks!
from odata2poco.
A new version 3.2.0.7 including fix to this issue can be downloaded from github
from odata2poco.
Related Issues (20)
- MaxLength for a String property HOT 13
- Support for read-only attributes from *.edmx HOT 2
- Case option not applied to type names HOT 6
- Question: generate poco only for some dynamic365 entities HOT 7
- Outdated EDM library and use of System.Text.Json? HOT 4
- Nullable Microsoft.OData.Edm.Date HOT 5
- Documentation HOT 2
- Feature Request: Add used options to output HOT 3
- Possible to add field descriptions from metadata to C# output HOT 4
- How to deal with lookups in EDMX? HOT 3
- Support .NET 5+ HOT 2
- Add External Property Name Mapping HOT 2
- readonly option and metadata as string HOT 4
- Allow Headers in API Request HOT 3
- Not nullable enum and object members. HOT 9
- Drop support for target net45 HOT 1
- OpenType was not expected in the given context HOT 5
- Gzip encoded content HOT 5
- Announcing: Signing o2pgen.exe and all odata2poco.xxx.nupkg packages. HOT 1
- Announcing the new Release: V6.3.1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from odata2poco.