I have a model class that is following
public bool Saturday{ get; set; }
public bool Sunday{ get; set; }
public string Holiday{ get; set; }
In which I want to use the RequiredIf condition for the Holiday field using the both Saturday and Sunday fields. Can I use like following
[RequiredIf("Sunday,Saturday",false)]
public string Holiday{ get; set; }
So I don't know how to use the RequiredIf condition in my model class, So please someone help me
Maybe try this in your model:
My Project has RequiredIf in it.
It shows error message 'License is required.' when License is left blank only if SalesID is 1. License cannot be blank if SalesID is 1.
For your code it should be something like
It means if Sunday and Saturday are true you can allow Holiday property to be an Empty String.