public async Task <ActionResult <Retos> > PostRetos(Retos retos) { _context.Retos.Add(retos); await _context.SaveChangesAsync(); return(CreatedAtAction("GetRetos", new { id = retos.IdReto }, retos)); }
public async Task <IActionResult> PutRetos(int id, Retos retos) { if (id != retos.IdReto) { return(BadRequest()); } _context.Entry(retos).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RetosExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }