Wednesday, 20 September 2017

Need help with delete record in asp.net using Nhibernate

You cannot delete an entity that is not saved! try:
Contact contact = new Contact();
int contactid = 1; //are you managing manually entity id?


session.SaveOrUpdate(contact);

session.Delete(contact);
update
Contact contact=session.Get<Contact>(1);

session.Delete(contact);
session.Flush();

No comments:

Post a Comment

Note: only a member of this blog may post a comment.

Blog Archive