public async Task <ActionResult <CursoPersona> > PostCursoPersona(CursoPersona cursoPersona) { _context.CursoPersona.Add(cursoPersona); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCursoPersona", new { id = cursoPersona.Id }, cursoPersona)); }
public async Task <IActionResult> PutCursoPersona(int id, CursoPersona cursoPersona) { if (id != cursoPersona.Id) { return(BadRequest()); } _context.Entry(cursoPersona).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CursoPersonaExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }