angularjs - Can ngResource pass nested object into GET query? -


i using ngresource communicate web api. want send search request webapi controller object not flat:

var searchrequest = {    query: "hotel",    page: 1,    price:    {       min: 1000,       max: 2500    } } 

and controller takes searchrequest parameter same structure sent object request should like

http://localhost/api/search?query=hotel&page=1&price.min=1000&price.max=2500 

however, ngresource $resource.query(searchrequest) sending this:

http://localhost/api/search?query=hotel&page=1price=%7b%22min%22:1000,%22max%22:2500%7d 

if me change use odata attributed endpoint returns iqueryable. use breeze.js on frontend generate queries. have @ these:

https://ovaismehboob.wordpress.com/2014/01/18/adding-queryable-support-to-asp-net-web-api-controller-action-methods/

http://breeze.github.io/doc-js/server-odata.html

i wrong don't think work nested queries. solution might flatten query , use linq projection or automapper projection query data source depend on linq provider can handle


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -