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; } }
How can I get the result as a List<ProductRow> type?
I see there is a function Projection.Cast, but I don't see any documentation on how to use it.