Advertisement
digioz

nHibernate Update and Delete

May 26th, 2014
488
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.30 KB | None | 0 0
  1. // Delete
  2. using (mySession.BeginTransaction())
  3. {
  4.         mySession.Delete(loContact);
  5.         mySession.Transaction.Commit();
  6. }
  7.  
  8. // Edit
  9. using (mySession.BeginTransaction())
  10. {
  11.     loContact.FirstName = "Jane";
  12.     loContact.LastName = "Fonda";
  13.  
  14.     mySession.Update(loContact);
  15.     mySession.Transaction.Commit();
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement