Wednesday, August 30, 2017

ODATA - how to generate odata service from Edmx file

Leave a Comment

There is some Odata lib which I can use that from edmx file it generate an odata service? By providing only edmx file it create the service that can answer the metadata calls...

I've found this library

https://github.com/htammen/n-odata-server

But it requires json not edmx/metadata.xml file...

I see the Olingo lib but I didn't find any functionality that can do it ...

https://olingo.apache.org

Any direction if it possible?

I prefer to use some nodejs lib if there is some combination that could work, but its not mandatory

I've also find this lib https://github.com/jaystack/jaysvcutil

1 Answers

Answers 1

If you are happy to use .Net, you could try RESTier. Follow the instructions here: http://odata.github.io/RESTier/, except don't generate a new EF data model class. Instead add your edmx model into the project.

Then go to the section 'Configure the OData Endpoint', and rather than entering:

        await config.MapRestierRoute<EntityFrameworkApi<AdventureWorksLT>>(             "AdventureWorksLT",             "api/AdventureWorksLT",             new RestierBatchHandler(GlobalConfiguration.DefaultServer)); 

use your data model class (the class that inherits DbContext) rather than AdventureWorksLT in EntityFrameworkApi<AdventureWorksLT> , and change the route name and prefix to something more suitable.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment