public void Remove(Contact contact) { using(ISession session = NHibernateHelper.AbreSession()) { ITransaction tx = session.BeginTransaction(); session.Delete(contact); tx.Commit(); } }
public void Atualiza(Contact contact) { using(ISession session = NHibernateHelper.AbreSession()) { ITransaction tx = session.BeginTransaction(); session.Merge(contact); tx.Commit(); } }
private static void AdicionaContato() { Contact contact = new Contact(); contact.Name = "bada"; contact.Phone = "(22) 9999-9999"; contact.Email = "*****@*****.**"; contact.Birth = DateTime.Now; ContactDAO dao = new ContactDAO(); dao.Adiciona(contact); }