protected Func <string, bool> GetMatchMethod() { switch (Options.Match) { case KeyWordSearchMatch.AllWords: return((item) => KeyWords.All((keyWord) => item.Contains(keyWord))); case KeyWordSearchMatch.AnyWord: return((item) => KeyWords.Any((keyWord) => item.Contains(keyWord))); case KeyWordSearchMatch.ExactMatch: return((item) => item.Contains(Options.SearchString)); default: throw new ArgumentOutOfRangeException( paramName: nameof(Options.Match), actualValue: Options.Match, message: "Unknown Search Match Filter" ); } }