コード例 #1
0
        public async Task <ResultServiceVM> CreateProduct(ProductInVM productInVM)
        {
            Product product = Mapper.Map <Product>(productInVM);

            ResultService resultService = new ResultService(new ProductValidation().Validate(product));

            if (resultService.Success)
            {
                await _iProductRepository.InsertAsync(product);
            }

            return(Mapper.Map <ResultServiceVM>(resultService));
        }
コード例 #2
0
 public async Task <ResultServiceVM> CreateProduct([FromBody] ProductInVM productInVM)
 {
     return(await _iProductService.CreateProduct(productInVM));
 }