public void Save(kpis kpi) { using (ISession session = NHibernateHelper.OpenSession()) using (ITransaction transaction = session.BeginTransaction()) { session.Save(kpi); transaction.Commit(); } }
public void Delete(kpis kpi) { using (ISession session = NHibernateHelper.OpenSession()) using (ITransaction transaction = session.BeginTransaction()) { session.CreateQuery("delete from kpis u where u.Id = (:id)") .SetParameter("id", kpi.Id) .ExecuteUpdate(); transaction.Commit(); } }