public bool ExcludePath(string path) { if (Excludes != null) { if (Excludes.FirstOrDefault(e => (!e.Path.Contains("*") && path.Equals(e.Path, StringComparison.CurrentCultureIgnoreCase)) || (e.Path.StartsWith("*") && e.Path.EndsWith("*") && path.IndexOf(e.Path.Replace("*", ""), StringComparison.CurrentCultureIgnoreCase) >= 0) || (e.Path.StartsWith("*") && path.EndsWith(e.Path.Replace("*", ""), StringComparison.CurrentCultureIgnoreCase)) || (e.Path.EndsWith("*") && path.StartsWith(e.Path.Replace("*", ""), StringComparison.CurrentCultureIgnoreCase)) ) != null) { return(true); } } return(false); }