Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Nhibernate 有没有办法从IQueryable设置SQL注释?_Nhibernate_Iqueryable_Icriteria - Fatal编程技术网

Nhibernate 有没有办法从IQueryable设置SQL注释?

Nhibernate 有没有办法从IQueryable设置SQL注释?,nhibernate,iqueryable,icriteria,Nhibernate,Iqueryable,Icriteria,ICriteria有SetComment(),但我在NHibernate 5+中没有看到可与IQueryable相比的WithOptions扩展方法,允许设置一些特定于查询的选项,如超时、缓存选项和注释 var query = ( from e in session.Query<YourEntity>() select e ).WithOptions(o => o.SetComment("Your comment")); var查询=( 从session.Qu

ICriteria
SetComment()
,但我在NHibernate 5+中没有看到可与
IQueryable
相比的
WithOptions
扩展方法,允许设置一些特定于查询的选项,如超时、缓存选项和注释

var query = (
    from e in session.Query<YourEntity>()
    select e
).WithOptions(o => o.SetComment("Your comment"));
var查询=(
从session.Query()中的e
选择e
).WithOptions(o=>o.SetComment(“您的评论”);

您可能需要导入
NHibernate.Linq
名称空间。

非常感谢。我想,我必须升级到NH5才能尝试一下。也许本周晚些时候。。。