Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DetachedCriteria criteria1 = DetachedCriteria.For<SecurityObjectDTO>("so")
- .Add(Expression.Eq("ObjectCode", "1234"));
- XmlSerializer s = new XmlSerializer(typeof(DetachedCriteria));
- TextWriter writer = new StringWriter();
- s.Serialize(writer, criteria1);
- writer.Close();
- // Convert the DetachedCriteria to a byte array
- MemoryStream ms = new MemoryStream();
- IFormatter formatter = new BinaryFormatter();
- formatter.Serialize(ms, detachedCriteria);
- // Serialize the byte array
- XmlSerializer s = new XmlSerializer(typeof(byte[]));
- TextWriter writer = new StringWriter();
- s.Serialize(writer, ms.Buffer);
- writer.Close();
Add Comment
Please, Sign In to add comment