public async Task <T> Atualizar(object id, T entidade) { _context.Entry(entidade).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EntidadeExists(id)) { return(null); } else { throw; } } return(entidade); }
public async void Incluir(Ocorrencia ocorrencia) { _context.Ocorrencia.Add(ocorrencia); await _context.SaveChangesAsync(); }