Is it possible to combine dynamically expressions:
from c in collection where c.Property == true select c
with expression
from result in results
group result by result.Property
into g
select new g.Key
where 'results' should be the collection returned from first expression ?
I am going to use composed expression to fetch the data from db using NHibernate, so I would like the combined expression to be equal to if I would write it as
from c in collection
where c.Property == true
group c by c.Property
into g
select new g.Key
The expressions are defined in the class:
public class MyClass : MyAbstractClass<User>
{
public MyClass()
{
FirstExpression = users => from user in users where ... select user;
SecondExpression = results => from result in results
group result by result.Property into g
select g.Key
}
}