Beispiel #1
0
        public async Task <IActionResult <int> > Handle(ProductCategoryAddRequestDto request, CancellationToken cancellationToken)
        {
            await _validatorService.ValidateCommand(request);

            var category = _mapper.Map <Data.Entities.ProductCategory>(request);

            _categoryRepository.Add(category);

            return(ActionResult <int> .Success(category.Id));
        }
        public async Task <ActionResult <int> > AddProductCategory(ProductCategoryAddRequestDto dto)
        {
            var result = await _mediator.Send(dto);

            return(Ok(result.Data));
        }