public async Task Post([FromBody] ApiProduct product) { var dbProduct = _mapper.Map <Product>(product); dbProduct.Availability = 50; await _catalogService.AddProduct(dbProduct); }
public async Task Post([FromBody] APIProduct value) { var product = new Product() { Id = Guid.NewGuid(), Name = "SmartPhone" }; await productCatalogService.AddProduct(product); }
public async Task Post([FromBody] ProductDto product) { await _productCatalogService.AddProduct(new Product() { Id = product.Id, Name = product.Name, Description = product.Description, Availability = product.IsAvailable ? 1 : 0, Price = product.Price }); }
public async Task Post([FromBody] ApiProduct apiProduct) { var product = new Product { Id = Guid.NewGuid(), Name = apiProduct.Name, Description = apiProduct.Description, Price = apiProduct.Price }; await catalogService.AddProduct(product); }
public async Task Post([FromBody] ApiProduct product) { var mappedProduct = new Product() { Name = product.Name, Id = product.Id, Description = product.Description, Price = product.Price, Availability = 100 }; await _catalogService.AddProduct(mappedProduct).ConfigureAwait(false); }
public async Task Post([FromBody] Product product) { var catalogProduct = new ProductCatalog.Model.Product(); catalogProduct.Id = product.Id; catalogProduct.Name = product.Name; catalogProduct.Description = product.Description; catalogProduct.Availability = 100; catalogProduct.Price = product.Price; await _service.AddProduct(catalogProduct); }
public async Task Post([FromBody] ApiProduct product) { var newprod = new Product { Id = Guid.NewGuid(), Name = product.Name, Description = product.Description, Price = product.Price, Availability = 100 }; await _catalogService.AddProduct(newprod); }
public async Task AddProduct([FromBody] ApiProduct product) { var newProduct = new Product() { Name = product.Name, ProductID = product.ProductID, Avialability = 100, Description = product.Description, Price = product.Price }; await _productCatalogService.AddProduct(newProduct); }
public async Task Post([FromBody] ApiProduct product) { Product newProduct = new Product() { Id = Guid.NewGuid(), Name = product.Name, Description = product.Description, Price = product.Price, Availability = 150 }; await _productCatalogService.AddProduct(newProduct); }
public async Task Post([FromBody] Product product) { await _catalogService.AddProduct(product); }
public async Task Post(ProductViewModel product) { await _catalogService.AddProduct(new ProductCatalog.Model.Product { Id = Guid.NewGuid(), Description = product.Description, Name = product.Name, Price = product.Price }); }