matches
string jsondata = @"{""Id"":null,""FName"":""Raj"",""LName"":""Denny"",""DateofJoining"":null,""Date"":""2023 - 08 - 01T00: 00:00"",""CreatedBy"":""ICC0000389"",""levels"":{""RoleId"":""0"",""RoleName"":""select"",""IsActive"":false,""CreatedDate"":null,""CreatedBy"":""Admin""},""functionalities"":[{""levelID"":0,""levelName"":""create""}],""functionalityList"":[]}"; var jsonDictionary = JsonConvert.DeserializeObject<Dictionary<object, object>>(jsondata).ToDictionary(k => k.Key, k => (k.Value ?? "")); var jsonDictionaryList = jsonDictionary.Select(x => x.Value.ToString().ToUpper().Trim()); var matches = blockedList.Intersect(jsonDictionaryList);
public class SQLInjection { public int Id { get; set; } public string SQLWord { get; set; } } List<SQLInjection> listSQLInjection = new List<SQLInjection> { new SQLInjection {Id = 5 , SQLWord= "JOIN" }, new SQLInjection { Id = 8 , SQLWord= "CREATE " }, new SQLInjection { Id = 9 , SQLWord= "UPDATE" } };
if (regExpVal.Success && regExpVal.Value.ToUpper().Contains(val.ToUpper()))
regExpVal.Value.ToUpper()
val.ToUpper()