Using LINQ with collection filters

Description

Everything started with tweet: https://twitter.com/dariusz_lenart/status/596734206149001217.

I also thought that treating collection as IQueryable will be a nice feature. In docs I found CreateFilter method which allows querying collections using HQL. I tried implementing LINQ over collection without modifing NHibernate but it was not possible. LINQ to HQL translator (QueryModelVisitor, etc) was unable to put {filter-implied FROM} node to resut HQL tree. Even filter parameter in NhLinqExpression was unused, so I've implemented it.

Then I've created Queryable & QueryProvider implementation which combined FilterQueryPlan and LinqExpression to execute LINQ over connection which is available via CollectionQuery method on ISession.

What next?
My work is not done yet. I plan to test this is every weird configuration I can imagine (dictionaries, composite keys, etc) and make default collection classes (PersistanceGeneric...) implement IQueryable, so AsQueryable from BCL will work.

Environment

None

Status

Assignee

Alex Zaytsev

Reporter

Maciej Nowak

Components

Affects versions

4.0.3

Priority

Minor
Configure