public async Task <ActionResult <Furgo> > PostFurgo(Furgo furgo) { _context.Furgos.Add(furgo); await _context.SaveChangesAsync(); return(CreatedAtAction("GetFurgo", new { id = furgo.Id }, furgo)); }
public async Task <IActionResult> PutFurgo(Guid id, Furgo furgo) { if (id != furgo.Id) { return(BadRequest()); } _context.Entry(furgo).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FurgoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }