Пример #1
0
 public void SaveRate(Rate rate)
 {
     context.Rates.Attach(rate);
     context.Entry(rate).State = EntityState.Modified;
     context.SaveChanges();
 }
Пример #2
0
 public void DeleteUser(Users user)
 {
     context.Users.Attach(user);
     context.Entry(user).State = System.Data.Entity.EntityState.Deleted;
     context.SaveChanges();
 }
Пример #3
0
 public void SaveEntity(TEntity item, int itemId)
 {
     _context.Entry(item).State = itemId == 0 ? EntityState.Added : EntityState.Modified;
     _context.SaveChanges();
 }
Пример #4
0
 public void Update(Const @const)
 {
     context.Consts.Attach(@const);
     context.Entry(@const).State = EntityState.Modified;
     context.SaveChanges();
 }
 public async Task EditRequest(Requests requests)
 {
     context.Entry(requests).State = EntityState.Modified;
     await context.SaveChangesAsync();
 }
 public void DeleteMaterial(Materials material)
 {
     context.Materials.Attach(material);
     context.Entry(material).State = System.Data.Entity.EntityState.Deleted;
     context.SaveChanges();
 }
Пример #7
0
 public void DeleteHotel(Hotel hotel)
 {
     context.Hotel.Attach(hotel);
     context.Entry(hotel).State = System.Data.Entity.EntityState.Deleted;
     context.SaveChanges();
 }
Пример #8
0
 public void DeleteMrr(Mrr mrr)
 {
     context.Entry(mrr).State = EntityState.Deleted;
     context.Mrrs.Remove(mrr);
     context.SaveChanges();
 }
Пример #9
0
 public void Edit(Payout payout)
 {
     context.Payouts.Attach(payout);
     context.Entry(payout).State = EntityState.Modified;
     context.SaveChanges();
 }