在Linq到NHibernate我试图返回一定距离内的用户。以下是我迄今为止:Linq到NHibernate - 方法Cos没有实现
var query = from b in ActiveRecordLinq.AsQueryable<Business>()
where (3959 * Math.Acos(Math.Cos((Math.PI * coordinates.Latitude/180)) * Math.Cos((Math.PI * b.Latitude/180))
* Math.Cos((Math.PI * b.Longitude/180) - (Math.PI * coordinates.Longitude/180))
+ Math.Sin((Math.PI * coordinates.Latitude/180)) * Math.Sin((Math.PI * b.Latitude/180)))) <= radiusInMiles
orderby b.Name ascending
select b;
return query.ToList();
遗憾的是,似乎这样它给了我下面的错误的C#数学类不Linq中支持NHibernate的:
方法的Cos不实施
我该如何解决这个问题?
谢谢! Justin
HQL只是您使用以下参数注入参数的动态sql:?我有这个工作,我只是希望避免这种方法。 – Justin 2010-07-05 22:44:15
HQL不是SQL。它是一种面向对象的查询语言,语法非常类似于SQL。 – 2010-07-06 00:21:20
现已在3.3.3中实施。 https://nhibernate.jira.com/browse/NH-3092 – 2013-03-26 14:39:00