Result transformer that allows to transform a result to
a user specified class which will be populated via setter
methods or fields matching the alias names.
Namespace:
NHibernate.Transform
Assembly:
NHibernate (in NHibernate.dll)
Syntax
Examples
| Copy Code |
---|
IList resultWithAliasedBean = s.CreateCriteria(typeof(Enrollment))
.CreateAlias("Student", "st")
.CreateAlias("Course", "co")
.SetProjection( Projections.ProjectionList()
.Add( Projections.Property("co.Description"), "CourseDescription" )
)
.SetResultTransformer( new AliasToBeanResultTransformer(typeof(StudentDTO)) )
.List();
StudentDTO dto = (StudentDTO)resultWithAliasedBean[0];
|
Inheritance Hierarchy
See Also