示例#1
0
        public void ReturnPurchaseItems()
        {
            var returnedItems = PurchasedItems.ToList();

            PurchasedItems.Clear();

            DomainEvents.Raise(new ReturnedItemsEvent(DateTime.Now, returnedItems.ToArray()));
        }
示例#2
0
        public void UpdatePurchaseItems(IEnumerable <PurchaseItem> purchasedItems)
        {
            var returnedItems = PurchasedItems.ToList();

            DomainEvents.Raise(new ReturnedItemsEvent(DateTime.Now, returnedItems.ToArray()));

            PurchasedItems.Clear();
            PurchasedItems.AddRange(purchasedItems);
            DomainEvents.Raise(new PurchasedItemsEvent(DateTime.Now, purchasedItems.ToArray()));

            Modified = DateTime.Now;
        }