I'm using Expressive Annotations to selectively validate some of my models. One of them has these properties and requiredif dependency
[RequiredIf("ClusterId != 0")]
public Guid DefaultLocaleId { get; set; }
public int ClusterId { get; set; }
In case ClusterId == 0, DefaultLocaleId would be Guid.Empty. And yet we suddenly get a validation error that DefaultLocaleId has to be nullable for the RequiredIf attribute to work.
And I wonder why that is. ClusterId being null, there should be no validation of DefaultLocaleId in my opinion.
Hi
I'm using Expressive Annotations to selectively validate some of my models. One of them has these properties and requiredif dependency
In case ClusterId == 0, DefaultLocaleId would be Guid.Empty. And yet we suddenly get a validation error that DefaultLocaleId has to be nullable for the RequiredIf attribute to work.
And I wonder why that is. ClusterId being null, there should be no validation of DefaultLocaleId in my opinion.