コード例 #1
0
 public UpdatedCurrencies UpdateCurrencies(
     CantorWallet cantorWallet,
     IEnumerable <Currency> currencies,
     UpdatedCurrencies updatedCurrencies)
 {
     ValidateCantorWaller(cantorWallet);
     cantorWallet.PublicationDate = updatedCurrencies.PublicationDate;
     foreach (var currency in currencies)
     {
         var updatedCurrency = FindCurrency(updatedCurrencies, currency.Name);
         UpdateCurrency(currency, updatedCurrency);
         updatedCurrencies.Items.Remove(updatedCurrency);
     }
     return(updatedCurrencies);
 }
コード例 #2
0
 private Currency FindCurrency(UpdatedCurrencies updatedCurrencies, string currencyName)
 {
     return(updatedCurrencies.Items
            .FirstOrDefault(p => p.Name == currencyName));
 }
コード例 #3
0
 private bool ShouldUpdateCurrencies(CantorWallet cantorWallet, UpdatedCurrencies updatedCurrencies)
 {
     return(cantorWallet.PublicationDate != updatedCurrencies.PublicationDate);
 }