Пример #1
0
 public void DeleteAgency(Data.Entities.Agency agency)
 {
     using (var ctx = new TicketsContext())
     {
         ctx.Agencies.Remove(agency);
         ctx.SaveChanges();
     }
 }
Пример #2
0
 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();
     }
 }