title: Serialize DetachedCriteria with nHibernate
body: <p>I am trying to serialize a DetachedCriteria so I can save it in a database and reuse the same criteria at a later date. When I run the code below I get "NHibernate.Criterion.DetachedCriteria cannot be serialized because it does not have a parameterless constructor". </p>
  
  <pre><code>DetachedCriteria criteria1 = DetachedCriteria.For&lt;SecurityObjectDTO&gt;("so")
      .Add(Expression.Eq("ObjectCode", "1234"));
  
  XmlSerializer s = new XmlSerializer(typeof(DetachedCriteria));
  TextWriter writer = new StringWriter();
  s.Serialize(writer, criteria1);
  writer.Close();
  </code></pre>
  
  <p>Is there any good way to serialize a DetachedCriteria?</p>