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)); }
public async Task <ResultServiceVM> CreateProduct([FromBody] ProductInVM productInVM) { return(await _iProductService.CreateProduct(productInVM)); }