private static void CreateStringMapping() { foreach (var shift in Values()) { StringToShift.Add(shift.Value().ToLower(), shift); } }
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); }