Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private bool IsFilterContainsSubstring(SqlLiteral filterSql, params string[] columnsToTest)
- {
- if (filterSql == null || string.IsNullOrEmpty(filterSql.Value))
- {
- return false;
- }
- foreach (string column in columnsToTest)
- {
- if (filterSql.Value.Contains(column, StringComparison.OrdinalIgnoreCase))
- {
- Regex regex = new Regex($@"\W{column}\W", RegexOptions.IgnoreCase);
- MatchCollection matches = regex.Matches(filterSql.Value);
- if (matches.Count > 0)
- {
- return true;
- }
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement