Esempio n. 1
0
        //  [ValidationAspect(typeof(ProductCreateDtoValidator))]
        //[TransactionScopeAspect]
        public async Task <IResult> AddAsync(ProductCreateDto productCreateDto)
        {
            var productDto = await FillInData(productCreateDto);

            await _productColorFabricBlendService.AddRangeAsync(productDto.ProductColorFabricBlends);

            await _productVariantService.AddRangeAsync(productDto.ProductVariants);

            await _productDal.AddAsync(productCreateDto.Product);

            await _productDescriptionService.AddAsync(productCreateDto.ProductDescription);

            await _productAttributeService.AddRangeAsync(productCreateDto.ProductAttributes);

            return(new SuccessResult(Messages.ProductAdded));
        }