public void DeleteAgency(Data.Entities.Agency agency) { using (var ctx = new TicketsContext()) { ctx.Agencies.Remove(agency); ctx.SaveChanges(); } }
public void UpdateAgency(Data.Entities.Agency agency) { using (var ctx = new TicketsContext()) { ctx.Agencies.Attach(agency); ctx.Entry(agency).State = System.Data.Entity.EntityState.Modified; ctx.SaveChanges(); } }