我正在尝试进行一些分页和一些获取,但结果返回重复项。因此,我添加了 AliasToBeanResultTransformer,但随后出现以下错误:
在“ForumThread”类中找不到属性“this”的设置器
var crit = Session.CreateCriteria<ForumThread>()
.Add(Expression.Eq("IsActive", true))
.AddOrder(new Order("LastForumPost", false))
.SetFirstResult((page - 1)*pageSize)
.SetMaxResults(pageSize)
.SetFetchMode("ForumPosts", FetchMode.Eager)
.SetFetchMode("ForumTagRelations", FetchMode.Eager)
.SetCacheable(true)
.SetResultTransformer(new NHibernate.Transform.AliasToBeanResultTransformer(typeof (ForumThread)));
return crit.List<ForumThread>();
我可能会错过什么?