Nhibernate ICriteria sum字段求和

ICriteria criteria = NHibernateSession.CreateCriteria(typeof(DownloadLogEntity));
criteria.CreateAlias("Enduser", "enduser");
criteria.Add(Expression.Eq("enduser.EnduserID",enduserID));
criteria.Add(Expression.Between("DownloadTime", day, day.AddDays(1)));
criteria.SetProjection(Projections.Sum("FileSize"));
return (int)criteria.UniqueResult();

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注