List<object[]> products = GetSession().CreateCriteria<Product>()
.SetProjection(Projections.ProjectionList()
.Add(Projections.Property("Id"))
.Add(Projections.Property("Name"))
.Add(Projections.Property("Price"))
)
.List();
public class ProductRow { public int Id { get; set; } public string Name { get; set; } public double Price { get; set; } }
我怎样才能得到的结果作为List <ProductRow>类型类型化的类型?NHibernate的投影:如何获得使用标准API与投影
我看到有一个函数Projection.Cast,但我没有看到有关如何使用它的任何文档。
porjection - > projection Ceritria - > Criteria – labilbe 2010-02-14 08:16:10