我尝试使用decimal数据类型创建一个Predicate,但得到以下错误:
Error retrieving data.A binary operator with incompatible types was detected.
Found operand types 'Edm.Decimal' and 'Edm.Double' for operator kind 'Equal'.
Error: A binary operator with incompatible types was detected. Found operand types
'Edm.Decimal' and 'Edm.Double' for operator kind 'Equal'.下面是我尝试使用的代码:
// engineSize equals 1.4 in this case.
predicate.create('engineLitreCapacity', '==', engineSize);发布于 2014-11-25 16:15:27
我也有同样的问题。我找到了奥秘:)..。我认为这是与元数据和REST服务控制器符号相关的命名约定中的一些东西:例如:
不起作用
/*Breeze Controller Server Side*/
[HttpGet]
public IQueryable<Product> Items()
{
return _contextProvider.Context.Products;
}
/*Client*/
query = breeze.EntityQuery
.from("Items")
.where(Predicate.create('BasePrice', >', 1)
.orderBy(sortString)
.select(selectData)
.skip(skip)
.take(take)
.inlineCount();它成功了!!
/*Breeze Controller Server Side*/
[HttpGet]
public IQueryable<Product> Products()
{
return _contextProvider.Context.Products;
}
/*Client*/
query = breeze.EntityQuery
.from("Products")
.where(Predicate.create('BasePrice', >', 1)
.orderBy(sortString)
.select(selectData)
.skip(skip)
.take(take)
.inlineCount();发布于 2014-02-19 02:17:04
需要对engineSize执行parseFloat操作
predicate.create('engineLitreCapacity', '==', parseFloat(engineSize));发布于 2014-02-20 01:32:44
“engineLitreCapacity”的元数据中的数据类型是什么?它是否与数据库中同一字段的数据类型相匹配?如果不是,您的元数据是如何初始化的,是通过FetchMetadata调用还是手动创建的?
https://stackoverflow.com/questions/21779259
复制相似问题