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