tags:

views:

26

answers:

1

With nHibernate, what happends when you want to return an object that doesn't map to a table/entity?

A: 

As long as it's based off of data in the database, but not necessarily your business entities, you can use a projection.

http://japikse.blogspot.com/2009/02/using-projections-and-transformers-in.html
http://elegantcode.com/2007/10/30/nhibernate-projections/

Daniel Auger
To clarify this answer, you can project aggregate values based off of mapped properties, but you can't arbitrarily select unmapped columns without dropping back to SQL.
Stuart Childs