Could you provide 2 examples of using the .Delete with the query and the value and type arguments? I can not figure out the IType..
I try things such as .Delete("from assembly.Customer cst where cst._id = {0}", crit.ID, NHibernate.Type.GuidType); etc and get all sorts of errors.
I need some specific examples please.
sergey wrote:
NHibernate usually needs to load the deleted object to handle cascades and similar stuff. But if you have proxies enabled, you might get away with:
Code:
User userToDelete = session.Load(typeof(User), userId);
session.Delete(userToDelete);
But maybe Delete will still initialize the proxy, I'm not sure. Delete with the query argument executes the query, and deletes the objects returned. The value and type arguments are used to pass a parameter to the query.