I found the following question that can combine multiple expressions Expression<Func<T,bool>>:
How to merge two Lambda C # expressions without calling?
I'm wondering, using such a technique, how you go about .OrderBy merger Expression<Func<Entity, Key>>with .Where Expression<Func<Entity, bool>>in one expression or type of inheritance type System.Linq.Expressions.Expression.
I am making a really shortened class of the QueryProvider class to accept T => T == ...Func through public methods .Whereand .OrderBy. This is done so that the expression created by this class is passed to the QueryTranslator to create the appropriate SQL.
When called from QueryProvider, the QueryTranslator of this style usually takes one System.Linq.Expressions.Expressionas an argument, which then translates into SQL.
I can follow and understand the question above to merge the two .WhereFuncs. The following blog post was particularly useful for this, and I followed each of the examples:
http://blogs.msdn.com/b/meek/archive/2008/05/02/linq-to-entities-combining-predicates.aspx
This CodeProject article is also useful:
http://www.codeproject.com/Articles/24255/Exploring-Lambda-Expression-in-C
When combining .OrderBy Func with .Where Func, however, the two have different common arguments. In case of. Where is a Func<Entity, bool>, and in the case of .OrderBy is a Func<Entity, Key>.
Combining these two expressions on the surface is not as straightforward as merging the two with the same generic arguments.
Func- (unsure of exact term) .Where Func .OrderBy Func. , , , System.Linq.Expressions.Expression. , , Expression<Func<Entity, bool>> Expression<Func<Entity,Key>>, Entity ?