public async Task <ActionResult <Boletados> > PostBoletados(Boletados boletados) { _context.Boletados.Add(boletados); await _context.SaveChangesAsync(); return(CreatedAtAction(nameof(GetBoletados), new { id = boletados.Id }, boletados)); }
public async Task <IActionResult> PutBoletados(long id, Boletados boletados) { if (id != boletados.Id) { return(BadRequest()); } _context.Entry(boletados).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BoletadosExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }