Exemplo n.º 1
0
 public async Task PostAsync([FromBody] ApiProduct product)
 {
     await _serviceProductCatalog.AddProductAsync(new Product
     {
         Id           = product.Id,
         Name         = product.Name,
         Description  = product.Description,
         Price        = product.Price,
         Availability = 0
     });
 }
        public async Task PostAsync([FromBody] ApiProduct product)
        {
            var newProduct = new Product()
            {
                Id           = Guid.NewGuid(),
                Description  = product.Description,
                Price        = product.Price,
                Availability = 100
            };

            await _service.AddProductAsync(newProduct);
        }
        public async Task PostAsync([FromBody] ApiProduct apiProduct)
        {
            var product = new Product
            {
                Id           = Guid.NewGuid(),
                Name         = apiProduct.Name,
                Description  = apiProduct.Description,
                Price        = apiProduct.Price,
                Availability = 100
            };

            await _service.AddProductAsync(product);
        }
        public async Task PostAsync([FromBody] ApiProduct apiProduct)
        {
            var newProduct = new Product.Model.Product()
            {
                Price        = apiProduct.Price,
                Name         = apiProduct.Name,
                Description  = apiProduct.Description,
                Availability = apiProduct.Availability,
                Id           = Guid.NewGuid()
            };

            await _service.AddProductAsync(newProduct);
        }
Exemplo n.º 5
0
        public async Task PostAsync(ApiProduct product)
        {
            var productObj = new Product
            {
                Price        = product.Price,
                Name         = product.Name,
                Availability = 100,
                Description  = product.Description,
                Id           = product.Id
            };

            await _service.AddProductAsync(productObj);
        }
Exemplo n.º 6
0
        public Task AddProductAsync([FromBody] ApiProduct product)
        {
            var newProduct = new Product
            {
                Id           = Guid.NewGuid(),
                Name         = product.Name,
                Description  = product.Description,
                Price        = product.Price,
                Availability = 100
            };

            return(_productCatalogService.AddProductAsync(newProduct));
        }
Exemplo n.º 7
0
        public async Task Post([FromBody] ApiProduct product)
        {
            var newProduct = new Product
            {
                Id           = Guid.NewGuid(),
                Availability = 100,
                Name         = product.Description,
                Description  = product.Description,
                Price        = product.Price
            };

            await _catalogService.AddProductAsync(newProduct);
        }
Exemplo n.º 8
0
        public async Task PostAsync([FromBody] ApiProduct product)
        {
          await  _service.AddProductAsync(
                new Product()
                {
                    
                    Name = product.Name,
                    Description = product.Description,
                    Price = product.Price,
                    Availbility = 1
                    
                }
                
                
                );

        }
Exemplo n.º 9
0
 public async Task CreateProductAsync([FromBody] Product product)
 {
     await _productCatalogService.AddProductAsync(product);
 }