public async Task <IActionResult> AddShopProduct([FromForm] ShopProductInput input) { Result <string> result = await _productManager.AddShopProduct(input); if (result.Success) { return(Ok(result)); } else { return(BadRequest(result)); } }
public async Task <Result <string> > AddShopProduct(ShopProductInput input) { Product product = new Product() { Title = input.Title, Price = input.Price, Description = input.Description, Size = input.Size, ProductType = input.ProductType, ImageUrl = input.ImageUrl }; return(new Result <string>() { Success = true, Data = await _productRepository.CreateAsync(product) }); }