pszczyg

Projection using ToDictionary()

Oct 3rd, 2019
295
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  List<ATMTaskTypePriorityEntry> taskTypePriorityEntries = _taskTypePriorityDatabaseAccess.GetAllPriorities(transactionArgs);
  2.  TaskTypePriorities = taskTypePriorityEntries
  3.                 .GroupBy(entry => entry.TaskTypeDbId)
  4.                 .Select(entries => new ATMTaskTypePriorities(entries.Key,
  5.                     entries.ToDictionary(entry => entry.EventThreshold, entry => entry.Priority))).ToList();
RAW Paste Data