382 Views
One thing that needs to be always remembered when writing NHibernate.Linq queries is that it is going to be translated into SQL eventually. What this means is that we can't do everything in our Select or Where conditions - we are restricted by the capabilities of underlying database and SQL language itself.
However, I believe I'm right in saying that an even easier way, and certainly more efficient (it doesn't require the conversion to a list and the corresponding allocation of memory) is to call `.AsEnumerable()` on the enumerable *after* the local operations but *before* the SQL operations.