OData Model Builder now Available

Sam Xu

Sam

How to empower developers to build OData Edm model easily from their data model (C# classes) is one of the most important task in OData team. Today, we are pleased to announce the first beta version of OData model builder available at https://www.nuget.org/packages/Microsoft.OData.ModelBuilder.

Please try this package by installing as:

Install-Package Microsoft.OData.ModelBuilder

The basic usage of the Edm model is to use the conventional model builder, here’s sample codes

ODataConventionModelBuilder modelBuilder = new ODataConventionModelBuilder();
modelBuilder.EntitySet<Customer>("Customers");
modelBuilder.EntitySet<Order>("Orders");
IEdmModel model = modelBuilder.GetEdmModel();

// Your date model (C# class)
public class Customer
{
  //
}
public class Order
{
  //
}

 

For all other detail usage of the model builder, please refer to: https://docs.microsoft.com/en-us/odata/webapi/model-builder-abstract

To release model builder as a simple package can also help developers to build their OData tooling ecosystem easily. Meanwhile, for OData team, it can fasten the model builder release cycle.  So, we are planning to introduce more features (for example, term configuration, vocabulary annotation, etc) in the next release. Please feel free to share your feature requirements, report issues at https://github.com/OData/modelbuilder.

Thanks!

2 comments

Comments are closed. Login to edit/delete your existing comments

  • nasreddine ferchichi
    nasreddine ferchichi

    Hi Sam
    I want to know if there is any documentation how to override the IEDM model builder to allow access to the entities properties depending on the user coming from basic authentication. when he make the call to the controller