Expression.In() 在 nhibernate 中的用途是什么以及等效的 sql 查询是什么?
最佳答案
它产生一个 SQL "IN" statement .
例如:
var idArray = new int[] { 1, 2, 3, 4, 5 };
Session.CreateCriteria(typeof(Foo))
.Add(Expression.In("Id", idArray)
.List<Foo>();
将生成相当于以下内容的 SQL:
select * from Foo where Foo.Id in (1, 2, 3, 4, 5)
关于c# - Nhibernate 标准 : Use of Expression. in(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25306782/