Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.02 KB | None | 0 0
  1.         public Dictionary<IGtpKey, List<IVoltageGraphParameterValue>> Select(
  2.             IEnumerable<IGtpKey> gtps,
  3.             LocalDate? operationDay = null)
  4.         {
  5.             if (gtps == null)
  6.             {
  7.                 throw new ArgumentNullException("gtps");
  8.             }
  9.  
  10.             LocalDate operationDayValue = operationDay ?? CalendarDateContext.CurrentDate;
  11.  
  12.             Dictionary<IGtpKey, List<IVoltageGraphParameterValue>> result = gtps.ToDictionary(
  13.                 x => x,
  14.                 x => new List<IVoltageGraphParameterValue>());
  15.  
  16.             foreach (IVoltageGraphParameterValue voltageGraphParameterValue in AtOperationDay(operationDayValue))
  17.             {
  18.                 List<IVoltageGraphParameterValue> deviceParameterValues;
  19.                 if (result.TryGetValue(voltageGraphParameterValue.Gtp, out deviceParameterValues))
  20.                 {
  21.                     deviceParameterValues.Add(voltageGraphParameterValue);
  22.                 }
  23.             }
  24.  
  25.             return result;
  26.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement