Minor updates in comments, so it is clearer.

This commit is contained in:
Cesar De la Torre 2017-10-30 18:12:28 -07:00
parent c706c1dedc
commit 48af69ce18

View File

@ -180,7 +180,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.Controllers
catalogItem = productToUpdate;
_catalogContext.CatalogItems.Update(catalogItem);
if (raiseProductPriceChangedEvent) // Save and publish integration event if price has changed
if (raiseProductPriceChangedEvent) // Save product's data and publish integration event through the Event Bus if price has changed
{
//Create Integration Event to be published through the Event Bus
var priceChangedEvent = new ProductPriceChangedIntegrationEvent(catalogItem.Id, productToUpdate.Price, oldPrice);
@ -191,7 +191,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.Controllers
// Publish through the Event Bus and mark the saved event as published
await _catalogIntegrationEventService.PublishThroughEventBusAsync(priceChangedEvent);
}
else // Save updated product
else // Just save the updated product because the Product's Price hasn't changed.
{
await _catalogContext.SaveChangesAsync();
}