public string GetShift(DayOfWeek day, int id) { Shift shift; string value; try { shift = Shifts.Single(x => x.Day == day && x.ScheduleID == id); value = $"<a href='/admin/editshift/{shift.ID}'>{shift.ToString()}</a>"; } catch (Exception ex) when(ex is ArgumentNullException || ex is InvalidOperationException) { value = null; } return(value); }