public async Task <ActionResult <Formando> > PostFormando(Formando formando) { _context.Formando.Add(formando); await _context.SaveChangesAsync(); return(CreatedAtAction(nameof(GetFormando), new { id = formando.FormandoId }, formando)); }
public async Task <IActionResult> PutFormando(int id, Formando formando) { if (id != formando.FormandoId) { return(BadRequest()); } _context.Entry(formando).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FormandoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> Put(Formando formando) { _db.Entry(formando).State = EntityState.Modified; await _db.SaveChangesAsync(); return(NoContent()); }
public async Task <IActionResult> Post(Formando formando) { _db.Add(formando); await _db.SaveChangesAsync(); return(Ok(formando.ID)); }
public async Task <IActionResult> Delete(Guid id) { var formando = new Formando { ID = id }; _db.Remove(formando); await _db.SaveChangesAsync(); return(NoContent()); }