This project is read-only.

Orchard WebApi and OData

Topics: Customizing Orchard, Writing modules
Dec 30, 2012 at 11:33 PM
Edited Nov 25, 2013 at 11:12 AM
Since OData is not supported out of the box at the latest version of Orchard, I created a module that includes all OData libraries from Nuget. It also adds support for the $format query field and jsonp formatter. Orchard.Odata working example at I used IOrchardShellEvents to register new formatters and query string mappings on GlobalConfiguration but although it works perfect, I don't know if this is the correct way to add or change information of the GlobalConfiguration in Orchard. If I try to package the module I get an error Cannot add part for the specified URI because it is already in the package. This is happening because the module includes under the Libs folder and references at the same time the OData libraries. Is there any way to include external libraries in an Orchard Module Package? Any further information would be much appreciated.
Nov 23, 2013 at 11:50 PM
What's the latest update on OData support for Orchard collections?

Is there anything more current than this Codeplex project?

Thank you,
Michael Herman (Toronto)
Nov 25, 2013 at 11:23 AM
Hello Michael ,

I will post as soon as possible the latest version of the Orchard.OData project that we use at Grapto for our WebAPI/OData needs. To see an example, get into Dashboard after you create an account.
The whole UI is created using javascript through OData, webapi calls.

The Orchard.OData project, enables Orchard to return OData with jsonp formatters and supports the [ExtendedQueryable] attribute to your ApiController so you can return filtered results.

Dec 13, 2013 at 10:33 AM
Can you please add this module to the gallery?

It would be very nice to be able to download this. I assume we will eventually need this ourselves too.

By the way, so far I've just included external libraries (dll's) in the /lib folder of my modules. Not sure if that is the best way to do it, but how else can you do it? You could also use NuGet, but then you'll still have to ship the actual dll's with your module, as Orchard does not download stuff from nuget when installing the module.
Dec 13, 2013 at 9:09 PM
Edited Dec 14, 2013 at 12:08 AM
Hello hkui,

This module depends on two libraries that after version 1.7.1 of Orchard are included in the main branch under the lib/windowsazure folder.

The version 5.2 of these libraries that are distributed with Orchard have issues with search and filtering. The server produces errors.

If you still want instructions and older versions of Microsoft.Data.EDM and Microsoft.Data.Odata to make it work in your own Orchard build, send me an email at ,

Hopefully Orchard will soon upgrade to version 5 WebApi and I will be able to post a new version of OData module.

Feb 21, 2014 at 10:21 AM
First of all: Thanks for all the work you have done!

Do you know if this module will be integrated in to the core and when it will be released? I'm looking forward to this module!
May 13, 2014 at 2:19 PM

It seems I tried to do something similar.
You might check from the gallery this module

Hoping this helps.
Thanks in advance for confirming :)
May 13, 2014 at 6:23 PM
@OSTEPHAN. what about making a demonstration at our weekly meeting ?
May 16, 2014 at 3:59 PM
@sebastienros Why not :)
However, could be tell me when it occurs to check if I can schedule while it may depend on timezones ?

By the way, you can download module Orchard.OData from gallery and define your own defined contenttypes in your personal demo site if you want.
Or you may check mine that I'm trying to use for my Win8 store consumer app :$metadata

Known limitations :
  • no odata service operations supported, but in a CQRS strategy I'd rather use Odata in read-only mode, and ensure business rules in standard api controllers
  • no odata inheritance supported, but is Orchard plateform specific model made for ?
  • no odata associationset between contentypes supported, but is Orchard plateform specific model made for ?
Thx again for your interest and your comments !