Beispiel #1
0
        public async Task <ActionResult <Cotation> > PostCotation(Cotation bloc)
        {
            _context.Cotations.Add(bloc);
            await _context.SaveChangesAsync();

            return(CreatedAtAction(nameof(GetCotation), new { id = bloc.ID }, bloc));
        }
Beispiel #2
0
        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());
        }