I'm writting a general DAO interface and facing a difficult in general Query operation. Query operation requires a set of query conditions. I'd like to give a interface like
IList<TEntity> Query(DetachedCriteria criteria);
But this makes the interface rely on nHibernate. If I want to use Linq or plain SQL, it is not easy to convert DetachedCriteria to them.
I want to have a class that can wrap the query conditions just like DetachedCriteria in nHibernate, but can be converted to DetachedCriteria, or linq, or plain SQL.
I've once written a class in Java which wraps the query conditions and can be converted into plain SQL. I want to known whether there is any existing project in dot net that can do similiar work.