Over the weekend I came across a blog post about NHibernate, and an apparent work-around for a feature not supported by NHibernate.The original post can be found here: nHibernate LINQ workaround for System.NotSupportedException Basically the author wanted to write something along the lines of:
var fruitIds = new List<int> { 5, 8, 13 };using (var session = factory.OpenSession())
{
var result = from f in session.Query<NHFruit>()
join i in fruitIds
on f.Id equals i
select f; foreach (var fruit in result)
Console.WriteLine(fruit.Name);
}Where the query joins to a list of Ids to filter the results out. This however, happens to throw an exception:
Read more: Phillip Haydon
QR:
var fruitIds = new List<int> { 5, 8, 13 };using (var session = factory.OpenSession())
{
var result = from f in session.Query<NHFruit>()
join i in fruitIds
on f.Id equals i
select f; foreach (var fruit in result)
Console.WriteLine(fruit.Name);
}Where the query joins to a list of Ids to filter the results out. This however, happens to throw an exception:
Read more: Phillip Haydon
QR:
0 comments:
Post a Comment