I'm supporting a multi-tenant system that allows users to define custom forms. The data model is EAV based because issuing dynamic DDL to change table schema doesn't work when supporting multiple tenants in a single DB. An upcoming requirement is to build a flexible query designer that allows users to setup simple predicates against the custom forms they've defined:
Custom Date Field < DateTime.Today
And
Custom Number Field1 > 1000 and < 1500
Or
- Custom Number Field2 Is Null
I had intended to build this query engine by dynamically spooling SQL strings, but I wonder if Expression Trees offer a more testable and type-safe approach. Is this a good application for ETs?