Esempio n. 1
0
        public async Task <ActionResult> Update(int id, UpdatePizzaDTO dto)
        {
            var command = _mapper.Map <UpdatePizzaCommand>(dto);

            command.Id = id;

            await _mediator.Send(command);

            return(NoContent());
        }
Esempio n. 2
0
        public async Task <ActionResult> Update(int id, [FromBody] UpdatePizzaDTO dto)
        {
            using var uow = _unitOfWorkFactory.Create();

            await _pizzaService.UpdatePizzaAsync(
                id,
                dto.Name,
                dto.Description,
                dto.UnitPrice,
                dto.IngredientIds);

            uow.Commit();

            return(NoContent());
        }