> Or take LINQ to SQL. LINQ to SQL is great. Usually. If
> you're using it exactly as they intended. When we wanted to
> make some of our models automatically supply some query
> parameters, though...well, let's just say there was a lot
> of T4 templating involved to get around sealed classes, and
> leave it there.
I solved what sounds to be a similar problem using reflection and the Linq ExpressionBuilder class(and related classes). It actually turned out really clean and powerful.