private void Validate(string tagStr) { if (DisplayName?.Length > 256 || DisplayName?.IndexOfAny("^@,&=*'\"".ToCharArray()) > -1) { throw new ArgumentException( $"Property {nameof(DisplayName)} must be less than 256 characters, and must not contain characters ^@,&=*'\""); } if (NewOuterId?.Length > 255 || NewOuterId?.IndexOfAny("^@,&=*'\"".ToCharArray()) > -1) { throw new ArgumentException( $"Property {nameof(OuterId)} must be less than 255 characters, and must not contain characters ^@,&=*'\""); } if (tagStr?.Length > 255 || tagStr?.IndexOfAny("^@,&=*'\"".ToCharArray()) > -1) { throw new ArgumentException( $"Property {nameof(Tags)} must be less than 255 characters, and must not contain characters ^@,&=*'\""); } if (UserData?.Length * sizeof(char) > 16 * 1024 || UserData?.IndexOfAny("^@,&=*'\"".ToCharArray()) > -1) { throw new ArgumentException( $"Property {nameof(DisplayName)} must be less than 16KB, and must not contain characters ^@,&=*'\""); } }