Created
February 14, 2020 08:56
-
-
Save karthikeyanVK/d009ad79f4da95d864f0e4d17aa6c94f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public bool UpdateProductQuantity(OrderedProduct orderedProduct) | |
{ | |
using (var context = new PetShopContext()) | |
{ | |
var productFromDb = context.Products.Find(orderedProduct.ProductId); | |
productFromDb.Quantity -= orderedProduct.OrderedProductQuantity; | |
context.SaveChanges(); | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment