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

Activity

Show:

Alex Zaytsev 
May 11, 2015 at 9:28 AM

Duplicates

Maciej Nowak 
May 11, 2015 at 8:41 AM

Duplicate

Details

Assignee

Reporter

Labels

Components

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created May 11, 2015 at 8:38 AM
Updated May 12, 2015 at 10:23 AM
Resolved May 11, 2015 at 9:28 AM
Who's Looking?