C# – Implementing NHibernate DetachedCriteria-like

c++icriterianhibernate

I would like to write something like DetachedCriteria but I don't want to use the ISession or Nhibernate at all…

All I need is the implementations for ICriterion and Expression.

after writing such Criteria -> I would like to generate an Xml Query or AD-Query or maybe even Query on collection (something like the Linq2Objects)

Do you have such sample?
Someone wrote such code?