public void Handle(PromotionRedeemed @event)
 {
     using (var context = _contextFactory.Invoke())
     {
         var orderReport = context.Find <OrderReportDetail>(@event.OrderId);
         orderReport.Promotion.WasRedeemed = true;
         orderReport.Promotion.SavedAmount = @event.AmountSaved;
         context.Save(orderReport);
     }
 }
Esempio n. 2
0
        public void Handle(PromotionRedeemed @event)
        {
            using (var context = _contextFactory.Invoke())
            {
                var promotionUsageDetail = context.Find <PromotionUsageDetail>(@event.OrderId);

                promotionUsageDetail.AmountSaved  = @event.AmountSaved;
                promotionUsageDetail.DateRedeemed = @event.EventDate;

                context.SaveChanges();
            }
        }