public async Task <IActionResult> PutEvento(int id, Evento evento) { if (id != evento.EventoId) { return(BadRequest()); } _context.Entry(evento).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EventoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <int> SaveAsync() { try { return(await _context.SaveChangesAsync()); } catch (Exception) { throw; } }