Golo wrote:
C#-Code:
double? average = session.CreateQuery("select avg(Stars) from Rating where Page = :Page").SetString("Page", url.Substring(url.LastIndexOf('/') + 1)).UniqueResult<double?>();
int count = session.CreateQuery("select count(*) from Rating where Page = :Page").SetString("Page", url.Substring(url.LastIndexOf('/') + 1)).UniqueResult<int>();
This seems strange to me, but all the examples fromthe docs use aliases. Just for kicks, have you tried using one? Like:
Code:
select avg(r.Stars) from Rating r where r.Page = :Page
Seems worth a try.