Esempio n. 1
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;
        }
Esempio n. 2
0
 public void SetPurchasedItems(List <PurchasedItem> items)
 {
     PurchasedItems.Clear();
     PurchasedItems.AddRange(items);
     OnPurchasedItemsChanged?.Invoke();
 }