Skip to content

Nhibernate Projection example

demmy edited this page Jan 23, 2015 · 2 revisions
var list = session.CreateCriteria(typeof(Pipe))
   .SetProjection(Projections.ProjectionList()
      .Add(Projections.Property("Number"), "Number")
      .Add(Projections.Property("Id"), "Id")
      .Add(Projections.Property("Status"), "Status")
      .Add(Projections.Property("Type"), "Type"))
   .SetResultTransformer(Transformers.AliasToBean(typeof(Pipe)))
   .List<Pipe>();