NHibernate Future<T> with Get()

馋奶兔 提交于 2019-12-01 08:25:28

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!