microsoft / CDM

The Common Data Model (CDM) is a standard and extensible collection of schemas (entities, attributes, relationships) that represents business concepts and activities with well-defined semantics, to facilitate data interoperability. Examples of entities include: Account, Contact, Lead, Opportunity, Product, etc.
https://powerplatform.microsoft.com/en-us/common-data-model/
Creative Commons Attribution 4.0 International
1.67k stars 526 forks source link

Docs on how to create C# classes #69

Closed shaggygi closed 3 years ago

shaggygi commented 5 years ago

Is there any documentation how to create C# interfaces/classes based on CDM? I'm hoping to create/use a .NET Standard API based on a set of defined entities.

It would be nice to have a core API that includes only the objects defined in CDM. We could then have separate APIs to reference that API to perform the interaction between data stores/apps.

Any help is appreciated.

oovanesy commented 5 years ago

hi, could you please describe what scenario/use you have in mind?

shaggygi commented 5 years ago

I might be off in the weeds while trying to understand CDM, but based on docs and blogs I've crossed, I think would help in a project my team is researching. I like the fact you can define a CDM folder that supposed to include your models (from primitives to complex models to extensions of models).

So I thought there would be provided APIs/SDKs that could convert the data into C# classes where we could use in apps and against data repos (understanding that would be most likely on us depending SQL, CosmoDB, CSV file, etc.).

For example, if I had a model for a CustomerOrder, I would eventually want to be able to do something like...

var customerOrder = new CustomerOrder();
customerOrder.OrderNumber = "1234ABCD";
// other defined properties...

One area I wasn't clear on was the Common Data Service. It appears the CDM folder contains all the data to perform things in data lakes, Azure and such. If we have the ability to separate just the models, I could see using in various apps including down to Commands, Telemetry, Interfaces as what the IoT Plug and Play (DTDL) team appears to be doing.

Sorry if not clear enough. Let me know if I need to provide more details.

JasonSowers commented 4 years ago

I have the same question.

charbull commented 4 years ago

This is exactly the purpose of OLGA. https://ecostruxure.github.io/OLGA/

Take an ontology model and generates C#, Java, Python code ...

Take a look