public async Task <ActionResult <Cotation> > PostCotation(Cotation bloc) { _context.Cotations.Add(bloc); await _context.SaveChangesAsync(); return(CreatedAtAction(nameof(GetCotation), new { id = bloc.ID }, bloc)); }
public async Task <IActionResult> PutCotation(int id, Cotation bloc) { if (id != bloc.ID) { return(BadRequest()); } _context.Entry(bloc).State = EntityState.Modified; await _context.SaveChangesAsync(); return(NoContent()); }