public static void RemoveTenant(tenant_tbl tenant) { using (HomeCommitteeDBEntities db = new HomeCommitteeDBEntities()) { db.Entry(tenant).State = EntityState.Deleted; db.SaveChanges(); } }
public static void Add(tenant_tbl tenant) { try { using (HomeCommitteeDBEntities db = new HomeCommitteeDBEntities()) { db.tenant_tbl.Add(tenant); db.SaveChanges(); } } catch (Exception e) { throw e; } }
public static void UpdateTenantDetails(tenant_tbl tenant) { try { using (HomeCommitteeDBEntities db = new HomeCommitteeDBEntities()) { db.Entry(tenant).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } } catch (Exception e) { throw e; } }