コード例 #1
0
 public async Task<HttpResponseMessage> UpdateAsync(ProductUpdateModel model, long id)
 {
     await Services.Management.UpdateProductAsync(model, id);
     return Request.CreateResponse(HttpStatusCode.OK);
 }
コード例 #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();
        }