c# - OData no http resource was found that matches the request uri -


i'm having trouble getting odata service working mvc 4 site.

can me figure out i'm doing wrong?

here webapiconfig:

  public static class webapiconfig {     /// <summary>     /// register method     /// </summary>     /// <param name="config">the config.</param>     public static void register(httpconfiguration config)     {         config.mapodataserviceroute("odata", "odata", getedmmodel(), new defaultodatabatchhandler(globalconfiguration.defaultserver));         config.ensureinitialized();     }     private static iedmmodel getedmmodel()     {         odataconventionmodelbuilder builder = new odataconventionmodelbuilder();         builder.namespace = "thisclassesnamespace";         builder.containername = "defaultcontainer";         builder.entityset<queryrequest>("queryrequests");         var edmmodel = builder.getedmmodel();         return edmmodel;     } } 

here global.asax's application_start method:

  protected void application_start()     {         application["name"] = "administration web console";         globalconfiguration.configure(webapiconfig.register);         arearegistration.registerallareas();          registerroutes(routetable.routes);          error += mvcapplication_error;          var maplayerdao = new maplayerdao();         maplayerdao.updateprovisioningdata();          var factory = new customcontrollerfactory();         controllerbuilder.current.setcontrollerfactory(factory);      } 

finally, here controler's method looks like

 public class queryrequestscontroller : odatacontroller {     private static odatavalidationsettings _validationsettings = new odatavalidationsettings();     private queryrequestdao dao = new queryrequestdao();      // get: odata/queryrequests     [httpget]     public ihttpactionresult getqueryrequests()     {         // validate query.         try         {            // queryoptions.validate(_validationsettings);         }         catch (odataexception ex)         {             return badrequest(ex.message);         }           return ok<ienumerable<queryrequest>>(dao.getqueryrequests());     } 

i can metadata fine @ http://10.78.14.177:8040/odata/

which gives me:

{  "@odata.context":"http://10.78.14.177:8040/odata/$metadata","value":[ {   "name":"queryrequests","kind":"entityset","url":"queryrequests" } 

] }

but when go http://10.78.14.177:8040/odata/queryrequests no http resource found matches request uri 'http://10.78.14.177:8040/odata/queryrequests'.

i think mvc routing getting request , not going odata service... i'm not sure fix is.

any ideas?


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -