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.TransformAssembly: NHibernate (in NHibernate.dll) Version: 3.2.0.4000 (3.2.0.4000)
Syntax
Examples
CopyC#
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