The validation is occurring on the parameter, not within the function. The validation is ensuring that there is no empty values in the array and if you wish to override the default behavior you can provide the [AllowEmptyString()]. The parameter is being validated because internally the intention is to do a for loop to process each item, such as a computername which would break because it’s null. If you do allow empty strings, you still have to handle the null value in your code. Parameter validation is basically trying to prevent issues later, so it is validating it’s ready to be processed by the function.
Viewing 1 reply thread
The topic ‘Function fall down if it have got the array with empty string’ is closed to new replies.