Esempio n. 1
0
 public async Task UpdateAsync(Seller seller)
 {
     try
     {
         if (!_context.Seller.Any(x => x.Id == seller.Id))
         {
             throw new NotFoundException("Id not found");
         }
         _context.Update(seller);
         _context.SaveChanges();
     }
     catch (DbUpdateConcurrencyException ex)
     {
         throw new DbConcurrencyException(ex.Message);
     }
 }
Esempio n. 2
0
 public void Insert(Seller obj)
 {
     _context.Add(obj);
     _context.SaveChanges();
 }