1public long GetRegisteredUserCount(int countryId)
2 {
3 string sql = "select count(*) Ret from [user] u inner join UserWidget on u.id = userwidget.userid where u.CountryId = :country";
4 ISQLQuery query = NHibernateSession.CreateSQLQuery(sql);
5 query.SetInt32("country", countryId);
6 query.AddScalar("Ret", NHibernateUtil.Int64);
7
8 object result = query.UniqueResult();
9 return result == null ? 0 : Convert.ToInt64(result);
10 }