Ejemplo n.º 1
0
        public async Task <ActionResult> AjouterBox([FromBody] BoxDTO boxDTO)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            Box box = mapper.Map <Box>(boxDTO);

            box = await boxDAO.AjouterBox(box);

            return(Created($"api/Box/{box.Id}", mapper.Map <BoxDTO>(box)));
        }