From the Expressive Annotations GitHub : [
^]
Quote:
RequiredIf attribute is not working, what is wrong?
Make sure RequiredIf is applied to a field which accepts null values.
In the other words, it is redundant to apply this attribute to a field of non-nullable value type, like e.g. int, which is a struct representing integral numeric type, DateTime, etc. Because the value of such a type is always non-null, requirement demand is constantly fulfilled. Instead, for value types use their nullable forms, e.g. int?, DateTime?, etc.
[RequiredIf("true")] // no effect...
public int Value { get; set; } // ...unless int? is used
[RequiredIf("true")] // no effect...
public DateTime Value { get; set; } // ...unless DateTime? is used
If this doesn't help you, you can open an issue,