Orchard WebApi and OData

Topics: Customizing Orchard, Writing modules
Dec 30, 2012 at 10:33 PM
Edited Nov 25, 2013 at 10: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 grapto.com 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 10: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 10: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.

Cheers,
Fotis
Dec 13, 2013 at 9: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 8:09 PM
Edited Dec 13, 2013 at 11:08 PM
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 fotisgpap@grapto.com ,

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

Cheers,
Fotis
Feb 21 at 9: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!