Esempio n. 1
0
        public async Task <IActionResult> PutLivreur([FromRoute] int id, [FromBody] Livreur livreur)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != livreur.IdLivreur)
            {
                return(BadRequest());
            }

            _context.Entry(livreur).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!LivreurExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Esempio n. 2
0
        public async Task <IActionResult> PutClientPro([FromRoute] int id, [FromBody] ClientPro clientPro)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != clientPro.IdClientpro)
            {
                return(BadRequest());
            }

            _context.Entry(clientPro).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ClientProExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }