Ejemplo n.º 1
0
 private static void CreateStringMapping()
 {
     foreach (var shift in Values())
     {
         StringToShift.Add(shift.Value().ToLower(), shift);
     }
 }
Ejemplo n.º 2
0
        public static Shift From(string shiftName)
        {
            StringToShift.TryGetValue(shiftName.ToLower(), out var outValue);
            if (outValue == null)
            {
                throw new ArgumentException($"Shift '{shiftName}' not in list of shifts: {Utils.ToCsv(Values())}");
            }

            return(outValue);
        }