public async Task<HttpResponseMessage> UpdateAsync(ProductUpdateModel model, long id)
 {
     await Services.Management.UpdateProductAsync(model, id);
     return Request.CreateResponse(HttpStatusCode.OK);
 }
Exemplo n.º 2
0
        public async Task<int> UpdateProductAsync(ProductUpdateModel model, long productId)
        {
            var product = await _repositories.Products.FindAsync(productId);

            product.Description = model.Description;
            product.Name = model.Name;
            product.QuantityAvailable = model.QuantityAvailable;

            return await _repositories.SaveChangesAsync();
        }