public async Task Update(Phone entity)
 {
     using (_context = new PhonesContext())
     {
         _context.Entry(entity.Modelo).State = EntityState.Modified;
         _context.Entry(entity).State        = EntityState.Modified;
         await _context.SaveChangesAsync();
     }
 }
Beispiel #2
0
 public async Task Update(Modelo model)
 {
     using (_context = new PhonesContext())
     {
         _context.Entry(model).State       = EntityState.Modified;
         _context.Entry(model.Marca).State = EntityState.Unchanged;
         await _context.SaveChangesAsync();
     }
 }
 public async Task Update(RepairOrder entity)
 {
     using (_context = new PhonesContext())
     {
         _context.Entry(entity.Phone).State   = EntityState.Modified;
         _context.Entry(entity.Cliente).State = EntityState.Modified;
         _context.Entry(entity).State         = EntityState.Modified;
         await _context.SaveChangesAsync();
     }
 }
 public async Task Delete(Phone entity)
 {
     using (_context = new PhonesContext())
     {
         _context.Entry(entity).State = EntityState.Deleted;
         await _context.SaveChangesAsync();
     }
 }
Beispiel #5
0
 public async Task Delete(Modelo model)
 {
     using (_context = new PhonesContext())
     {
         model = _context.Modelos.Find(model.Id);
         _context.Entry(model).State = EntityState.Deleted;
         await _context.SaveChangesAsync();
     }
 }
Beispiel #6
0
 public void Update(Reservation reservation)
 {
     _context.Reservations.Attach(reservation);
     _context.Entry(reservation).State = EntityState.Modified;
     _context.SaveChanges();
 }