When using CreateSqlQuery, is it possible to retrieve an ordered list of the returned column names? Using .List only returns a list of the object values, not the column aliases.
If you apply an IResultTransformer
to your query via SetResultTransformer()
, it will be called with two lists containing column names and values.
There are several existing transformers in namespace NHibernate.Transform, such as:
AliasToEntityMapResultTransformer
Creates a map from column names to values for each row.AliasToBeanResultTransformer
Creates an object of the nominated type per row and sets its properties with the value from the column of the same name.ToListResultTransformer
Returns a list of values for each row.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With