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
C# |
---|
[SerializableAttribute] public class AliasToBeanResultTransformer : IResultTransformer |
Visual Basic |
---|
<SerializableAttribute> _ Public Class AliasToBeanResultTransformer _ Implements IResultTransformer |
Visual C++ |
---|
[SerializableAttribute] public ref class AliasToBeanResultTransformer : IResultTransformer |
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];