vb.net - Error querying DTO navigation properties with "any" -
in breezecontroller
have method returns dto 2 properties. 1 property navigation property 1 of entities, , other boolean:
public function projectlist() iqueryable homecoming p in _contextprovider.context.projects not p.isdeleted select new projectlistitem() { .project = p, .hastasks = (from t in _contextprovider.context.projecttasks t.projectid = p.id).any() } end function public class projectlistitem public property project project public property hastasks boolean end class
simple queries against method work fine, project
class has collection of project managers, , using "any" query against collection failing in breeze client code, before sending query server, next error message:
exception thrown @ line 10698, column 13 in http://localhost:2780/myapp/scripts/breeze.debug.js 0x800a138f - javascript runtime error: unable property 'isanonymous' of undefined or null reference
this in proto._validate
method of fnnode
, entitytype
null.
my query (i'm trying find projects specific project manager) built in pieces, relevant parts are:
var p = breeze.predicate.create("projectmanagerid", op.equals, id); var predicate = breeze.predicate.create("project.projectmanagers", "any", p); // code mutual queries... var query = breeze.entityquery.from("projectlist"); query = query.where(predicate); query = query.select("project.prop1,project.prop2,project.etc,hastasks"); homecoming query.using(this.manager).execute();
i create other predicates , run them through same mutual logic , work fine, seems limited "any" queries, e.g. 1 works...
predicate = breeze.predicate.create("project.clientnumber", op.contains, search) .or("project.clientname", op.contains, search) .or("project.notes", op.contains, search);
i still using breeze 1.4.16 (webapi v1, .net 4.0), have tried updating breeze.client bundle 1.5.1, makes no difference.
any ideas i'm doing wrong?
if manually build odata query looking for, results want, e.g.
class="lang-none prettyprint-override">http://localhost:1234/myapp/breeze/mycontroller/projectlist?$filter=project/projectmanagers/any(p:p/projectmanagerid eq 234)&$select=project/prop1,project/prop2,hastasks
vb.net breeze
No comments:
Post a Comment