I have some instances for reporting where executing sprocs is easier and simpler than complicated QueryOver statements.
I have a DTO, not an entity, that represents
With CreateSQLQuery, the following would work without any mapping file. Maybe you can give it a try with named queries :
public class YourDto
{
public int YourDtoId { get; set; }
public string YourDtoTitle { get; set; }
}
then
var result = yourNhSession
.CreateSQLQuery("select yourColumn1 as YourDtoId, yourColumn2 as YourDtoTitle from YOUR_TABLE")
.SetResultTransformer(Transformers.AliasToBean<YourDto>())
.List<YourDto>();
If you want the simplest solution I suggest you add in your architecture a micro / orm like Dapper to do this. It is just dropping a single file in your project and follow the sample. In order to me it is the best solution to pair to NH when you have to do the thinghs that are for some reason out of the entity logic.