C# Nhibernate标准:使用Expression.in()
nhibernate中Expression.In()的用途是什么?等效的sql查询是什么?它生成一个 例如:C# Nhibernate标准:使用Expression.in(),c#,mysql,nhibernate,C#,Mysql,Nhibernate,nhibernate中Expression.In()的用途是什么?等效的sql查询是什么?它生成一个 例如: var idArray = new int[] { 1, 2, 3, 4, 5 }; Session.CreateCriteria(typeof(Foo)) .Add(Expression.In("Id", idArray) .List<Foo>(); select * from Foo where Foo.Id in (1, 2, 3, 4, 5)
var idArray = new int[] { 1, 2, 3, 4, 5 };
Session.CreateCriteria(typeof(Foo))
.Add(Expression.In("Id", idArray)
.List<Foo>();
select * from Foo where Foo.Id in (1, 2, 3, 4, 5)