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:
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
Post a Comment