public async Task <ActionResult <CursoItem> > PostCursoItem(CursoItem item) { _context.CursoItems.Add(item); await _context.SaveChangesAsync(); return(CreatedAtAction(nameof(GetCursoItem), new { id = item.CursoId }, item)); }
public async Task <IActionResult> PutCursoItem(string cursoId, CursoItem item) { if (cursoId != item.CursoId) { return(BadRequest()); } _context.Entry(item).State = EntityState.Modified; await _context.SaveChangesAsync(); return(NoContent()); }