pszczyg

ToDictionary2

Oct 3rd, 2019
292
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  public void ReloadCache(TransactionArgs transactionArgs = null)
  2.         {
  3.             List<ATMTaskTypePriorityEntry> taskTypePriorityEntries = _taskTypePriorityDatabaseAccess.GetAllPriorities(transactionArgs);
  4.             TaskTypePriorities = ConvertTableEntriesToTaskTypePriorities(taskTypePriorityEntries);
  5.         }
  6.  
  7.         private List<ATMTaskTypePriorities> ConvertTableEntriesToTaskTypePriorities(List<ATMTaskTypePriorityEntry> taskTypePriorityEntries)
  8.         {
  9.             return taskTypePriorityEntries
  10.                 .GroupBy(entry => entry.TaskTypeDbId)
  11.                 .Select(entries => new ATMTaskTypePriorities(entries.Key,
  12.                     entries.ToDictionary(entry => entry.EventThreshold, entry => entry.Priority))).ToList();
  13.         }
RAW Paste Data