c# - A binary operator with incompatible types was detected. Found operand types edm.string and edm.guid for kind equal -
i implementing filter using breeze predicate. using breezejs , asp.net webapi(breeze server side) entity framework
the predicate looks this:
var predicate = breezeprovider.breeze.predicate.create('serialnumber', '==', $scope.filter.serialnumber); predicates.push(predicate);
when execute query. breeze throw exception following messages:
a binary operator incompatible types detected. found operand types edm.string , edm.guid kind equal
the $scope.filter.serialnumber string , serialnumber guid property
the url follow.
http://localhost:51969/breeze/warehouseproducttransactions/getproducts?$filter=(statusid ne 3d) , (warehouseid eq 1d) , (authorizedaduserid eq 'btdbnw8t6uu4d4khcoqohg==') , (serialnumber eq guid'1b9d065e-eb48-4f3d-883c-2c841771a3e8')&$orderby=id&$top=5&$expand=inventory,authorizedaduser&$inlinecount=allpages&)
note snippet:
(serialnumber eq guid'1b9d065e-eb48-4f3d-883c-2c841771a3e8')
my server side follow:
[enablebreezequery(maxnodecount = 200)] public iqueryable<warehouseproducttransactiondetail> getproducts() { return _contextprovider.context.warehouseproducttransactiondetails; }
i'm trying figure out how can resolve situation no idea.
any appreciated
i had same issue when comparing userid in breeze query. breeze appends 'guid' in odata query.
i able fix issue appending .totype("entitytypename")
breeze query.
let query = new breeze.entityquery().from('orders'); let predicate = breeze.predicate.create("createdby", "==", userid); query = query.where(predicate).totype("order");
Comments
Post a Comment