0
votes

We are currently looking at converting from WCF Data Services to WebApi with Odata. Our entity model is defined using an entity framework defined as an edmx. Im struggling to get the edmx working with WebApi OData due to relationships and complex properties.

I'm just wondering whether someone has successfully implemented webAPI with odata on a bigger sized edmx (that has relationships as well)? Any advice would be great.

1
odata is quite limited, however, I have created a framework to create JSON API quickly over DbContext, however you can use similar features to create your own library, github.com/neurospeech/atoms-mvc.net , a quick tip, you should consider moving out of EDMX and EF7 onwards there is no support for EDMX and DbContext is preferred. Instead, we are using text templates to generate classes and we have included them in the code.Akash Kava

1 Answers

1
votes

You may try using RESTier -- a .Net framework built upon Web API OData. There are several things you may need to pay attention:

  • RESTier has an EF provider which is quite similar with WCF data services. So it should work wiht the edmx model with little tweak.

  • RESTier is not a "competitor" for Web API OData, it's built upon Web API OData and can fallback to Web API OData.

  • RESTier currently is a preview version, but it has good support for the common features used of OData service.

If you tried out and find it cannot work, you can create an issues on https://github.com/odata/restier/issues with more detailed information, if you successfully make it work, it will be great you share your experience.