Example #1
0
        public ActionResult <Cliente> Put(int id, Cliente cliente)
        {
            _context.Attach(cliente).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            _context.SaveChanges();

            return(Ok(cliente));
        }
Example #2
0
 public async Task UpdateAsync(TEntity entity)
 {
     _context.Attach(entity);
     _context.Update <TEntity>(entity);
     _context.Entry(entity).State = EntityState.Modified;
     await _context.SaveChangesAsync();
 }