Is there a way to ignore the default null validation on nullable values if I don't care about that but I want to validate that, in case that the value is not null, for example I may want to perform other validation such as IsLongerThan(..) or anything else?
There are cases where I don't want to perform the null validation because that might be a valid value, but if there is actually a value, then I want to make sure it's no longer than a certain length or some other validation.
Example:
string? street = "123 Some Street";
Street = street.Throw().IsLongerThan(100);
Right now this is showing Warnings because string? must match notnull constraint to use it as parameter TValue.
Is there a way to ignore the default null validation on nullable values if I don't care about that but I want to validate that, in case that the value is not null, for example I may want to perform other validation such as IsLongerThan(..) or anything else?
There are cases where I don't want to perform the null validation because that might be a valid value, but if there is actually a value, then I want to make sure it's no longer than a certain length or some other validation.
Example:
Right now this is showing Warnings because
string?must matchnotnullconstraint to use it as parameterTValue.