读书人

LINQ to Entities 不识别方法“Double

发布时间: 2014-05-11 16:05:15 作者: rapoo

LINQ to Entities 不识别方法“Double Sqrt(Double)”,因此该方法无法转换为存储


double x=50;
var items=from t in CityAction where Math.Sqrt(t.CoorX)<=x select t;


报错:LINQ to Entities 不识别方法“Double Sqrt(Double)”,因此该方法无法转换为存储.

Math.Sqrt(t.CoorX)这个地方求平方根的时候报错,有什么办法可以解决?
[解决办法]
double x=50;
var items=from t in CityAction.ToList() where Math.Sqrt(t.CoorX)<=x select t;

读书人网 >.NET

热点推荐