XPO - Web API and OData V4 Support

05 July 2018

Want to expose your eXpress Persistent Objects™ (XPO) data model for CRUD operations through a lightweight JSON web service?

Our new Code Example implements a fully-functional OData V4 service with XPO and Web API. This solution relies on the Microsoft.AspNet.OData library, and is an alternative to our WCF-based XPO Data Service.  

Why is an OData Service ever needed?

Interoperability: As you may already know, XPO is a powerful ORM library for .NET. It provides a unified way to manage data for multiple database engines (14 supported databases). Even if your app is not for targeting the .NET Framework, it is still possible to take advantage of XPO's features. That is because clients for popular platforms (Windows, iOS, Android, Web, etc. can consume OData services. For more information on OData benefits, visit http://www.odata.org/

Why drop the previous XPO Data Service (OData V3)?

  • Functionality: OData V4 supports more features than OData V3: What’s New in OData Version 4.0.
  • Maintenance: According to Microsoft documentation, all REST feature enchancements will be made for ASP.NET Web API.
  • Flexibility: Web API Controllers are extension points, wherein you can add custom logic to manage/validate objects or customize a LINQ query.
  • Compatibility: Since the OASIC committee accepted OData V4, it has become a worldwide standard. Many developers use OData V4 and your service will be compatible with their applications.

Like it?

We created this example based on requests received from users. We hope to refine it with community feedback. For instance, this boilerplate code can be automated using the wizard. Drop us a line below once you've had an opportunity to test this feature, thanks.

See Also

XPO ORM Library – Available Free-of-Charge in v18.1!

Love XPO and want to help us promote it? Add the package through Nuget.org instead of DevExpress Nuget!


  DevExpress Support
  XPO team

10 comment(s)

Quite nice I like it!

It seems it should also be possible to run XPO with the recently released Microsoft.AspNetCore.OData (www.nuget.org/.../Microsoft.AspNetCore.OData) package, so running on dotnet core seems doable or will there be obvious obstacles?

5 July, 2018
Manuel Grundner [DevExpress MVP]

Awesome! :) That what i wanted for almost 7 years :) have to Update my Blog in this

5 July, 2018
Andrey Makhorin

Great! It's time to refactoring old solutions...

6 July, 2018
Thomas Vetterling

Good news for targetting crossplattform devices with an 'xpo'-Based OData Service.

Now we dont have to handle more than one 'model' of buisnessobjects.

Good job !!

6 July, 2018
Yekaterina K (DevExpress)

@YYannekk: Microsoft.AspNetCore.OData can have some specificities, so it is possible that some modifications will be required to use our example with this library. We did not yet research this and cannot answer your question. If you want to try it yourself, we would greatly appreciate your feedback. 

@Manuel: I'm happy to hear that this feature is so helpful for you. Looking forward to your new blog post! 

@Andrey, Thomas: Thank you for your feedback. You can count on our assistance if you face any difficulties.

6 July, 2018
Santiago Moscoso

Can we use Domain Components from a XAF application?

10 July, 2018

could you modify example to run as selfhosted without IIS ?

31 January, 2019
Dennis (DevExpress Support)

@Santiago Moscoso:

We have not researched DC use in this scenario. It is likely they will require additional adjustments as in www.devexpress.com/.../Q480762 and others.


We do not have a ready example - we will take your request into account for the future.

Unless I am mistaken, the greatest part of this task is to get Web API 2 working without XPO first. This is a general programming task that is covered in Microsoft documentation and other public community resources, for instance: docs.microsoft.com/.../use-owin-to-self-host-web-api. Once you implement this part, the XPO-related integration should work automatically.

Please keep us informed of your progress in this regard.

31 January, 2019
XPO Team Blog

Thanks to great user feedback, we had a successful release with several major new features. In this post, I will highlight a number of smaller, but useful additions to our ORM and its associated learning materials.

19 April, 2019
Marco Kummer

Has anyone had success using this OData example on .NET Core? @YYannekk ?

6 May, 2019

Please login or register to post comments.