Forum


HomeHomePublicPublicDevelopmentDevelopmentweb api OData in DNN8web api OData in DNN8
Previous
 
Next
New Post
2/23/2016 4:15 AM
 

HI, 

Has anyone gotten web api OData working inside DNN8?  I believe that to get this to work, there would need to be a change to the interface IMapRoute in the  DotNetNuke.web.api source, to add code to map an OData route like the code below. 

public interface IMapRoute
{
IList<Route> MapHttpRoute(string moduleFolderName, string routeName, string url, string[] namespaces);
IList<Route> MapHttpRoute(string moduleFolderName, string routeName, string url, object defaults, string[] namespaces);
IList<Route> MapHttpRoute(string moduleFolderName, string routeName, string url, object defaults, object constraints, string[] namespaces);
IList<Route> MapODataRoute(string moduleFolderName, string routeName, string routePrefix, Microsoft.OData.Edm.IEdmModel model);
}

Can I just download the source from Codeplex, and then get the DnnWebApi source and add it as a project, then add the Microsoft package for OData, and add the calls for OData and then recompile the DnnWebApi dll and see if that works?  I'm hoping that if I can do the groundwork I might be able to get DNN to add OData in a future release. 

One problem with this approach though is that when I did download the latest source code from Codeplex, last week, it did not compile.

What do you think of that?  Is there an easier way?


Thanks,

Cheryl Bearden

 

 
New Post
2/23/2016 5:11 AM
 

Hey Cheryl, good to hear from you!

I have not tried to integrate OData services into a DNN module.  Your solutions seems like it would be necessary in order to do it.  Although there is no DotNetNuke.Web.Api assembly or project.  The DotNetNuke.Web.Api namespace is in the larger DotNetNuke.Web assembly and project so you would need to get a full working DNN Platform solution loaded in order to build that assembly. 

That said, I don't think I would try it.  Is there a benefit for OData that supersedes the extra work you need to enable flexible "querying" of the data using WebAPI and Linq?  

You don't seem like the first person to want to do this though.  I see a few forum posts from people asking the very same thing.

http://www.dnnsoftware.com/forums/threadid/523726/scope/posts/creating-a-service-module-with-odata-support

http://www.dnnsoftware.com/forums/thr...

Maybe try contacting one of these users and see if they made any progress?

-Scott

 

 

 
New Post
2/23/2016 9:01 AM
 

Hi Scott, 

  Nice to hear from you also!  I still have production modules running well using some of your templates from years back, so thanks again for your development help!  I could follow your steps back when I didn't know anything, so your demos were super helpful.

I have alot of OData queries written because I use the Kendo controls (Kendo is javascript - jquery)  from Telerik and they use OData.  Many of these Kendo controls are running inside DNN modules (one of which is a MVC module that I built using the MVC Bridge in DNN 7.01.01).  Right now my OData queries are external to DNN but I also have web api controls (not OData) running internal to DNN as well.  Once I heard that DNN8 had json web tokens, I was hoping to use DNN also to house the OData queries that we use in our web and mobile apps.  But I agree, I hate the idea of going in and changing the source code, and getting that entire platform working would be a big job.

So I may just look for another solution for securing the OData web api's for mobile apps.  Securing them was easy for web apps. I used CORs because I could just specify which domains could access them.  But I'll have to find a different way to secure the OData web api's for the mobile apps that are not in DNN.

But thanks for the feedback and I will check out these other 2 links and see if they had any success.

I hope you all have a great time at DNNCon!  Wish I could go but I'll have to wait until next year. 

Take care,

Cheryl

 

 

 

 

 
Previous
 
Next
HomeHomePublicPublicDevelopmentDevelopmentweb api OData in DNN8web api OData in DNN8



Try FREE
30 days money back guaranteed