private bool ValidForContainsOperation(Func <string, TestProperty> propertyProvider) { bool valid = true; // It is OK for propertyProvider to be null, no syntax check will happen. // Check validity of operator only if related TestProperty is non-null. // if null, it might be custom validation ignore it. if (null != propertyProvider) { TestProperty testProperty = propertyProvider(Name); if (null != testProperty) { Type propertyType = testProperty.GetValueType(); valid = typeof(string) == propertyType || typeof(string[]) == propertyType; } } return(valid); }