public void Update(ProductModel product) { var updatedProduct = GetByProductCode(product.ProductCode); updatedProduct.Price = product.Price; //updatedProduct.ProductCode = product.ProductCode; updatedProduct.Stock = product.Stock; _db.Update(updatedProduct); _db.SaveChanges(); }
public void Update(CampaignModel campaign) { var updatedCampaign = GetByCampaignName(campaign.CampaignName); updatedCampaign.Duration = campaign.Duration; updatedCampaign.CampaignName = campaign.CampaignName; updatedCampaign.PriceManipulationLimit = campaign.PriceManipulationLimit; updatedCampaign.ProductCode = campaign.ProductCode; updatedCampaign.TargetSalesCount = campaign.TargetSalesCount; updatedCampaign.Status = campaign.Status; _db.Update(updatedCampaign); _db.SaveChanges(); }