问题
How can I use Future for delayed execution with Get() to retrieve a single record (or Load()?)
Also, can I use Future with a detached QueryOver
回答1:
Future with Load does not make any sense, as Load does not go to the DB.
Future with get doesn't make sense either, as Get returns an instance which might already be loaded, in which case it doesn't go to the DB either. The closest you can get to that is a query by id.
In order to get a Future<T>
you need an executable query (Criteria/QueryOver/HQL/LINQ). Otherwise, future has no way of resolving it.
来源:https://stackoverflow.com/questions/5681342/nhibernate-futuret-with-get