I have the following classes:
class A {
[Required]
public string Status { get; set; }
public B b_instance { get; set; }
}
class B {
**[RequiredIf("A.Status == 'Active'")**
public string x { get; set; }
}
As above, I want class B has a validation with the condition: A.Status = 'Active' then class B has [Required] x, otherwise b_instance.x is not required.