Пример #1
0
        /// <summary>
        /// Could persist this event on Database -> this will update the product as inactive
        /// </summary>
        /// <param name="e"></param>
        protected virtual void OnLowStock(LowStockChangeObjectEventArgs e)
        {
            EventHandler <LowStockChangeObjectEventArgs> handler = UpdateProduct;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Пример #2
0
 /// <summary>
 /// Remove Item from showcase
 /// It could send to the queue to update the Showcase bounded context
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void UpdateShowCase(object sender, LowStockChangeObjectEventArgs e)
 {
     Console.WriteLine($"Id: {id} - Updating item {e.ProductName} on Showcase");
 }
Пример #3
0
 /// <summary>
 /// Will persist Database
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void UpdateDatabase(object sender, LowStockChangeObjectEventArgs e)
 {
     Console.WriteLine($"Id: {id} - Update item {e.ProductName} on Database");
 }
Пример #4
0
 /// <summary>
 /// Will persist Database
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void UpdateRedisCache(object sender, LowStockChangeObjectEventArgs e)
 {
     Console.WriteLine($"Id: {id} - Updating item {e.ProductName} on Redis Cache");
 }