I have a View model
public class TrainingProgramScheduledDateVM
{
public bool IsTuesday { get; set; }
[DataType(DataType.Time)]
public string TueStartTime { get; set; }
[DataType(DataType.Time)]
public string TueEndTime { get; set; }
public bool IsWednesday { get; set; }
[DataType(DataType.Time)]
public string WedStartTime { get; set; }
[DataType(DataType.Time)]
public string WedEndTime { get; set; }
public bool IsThursday { get; set; }
[DataType(DataType.Time)]
public string ThuStartTime { get; set; }
[DataType(DataType.Time)]
public string ThuEndTime { get; set; }
}
I want to put the validation i a way that. 1- If IsTuesday = true Then TueStartTime and TueEndTime should Requires. and so on for other
2- At least one boolean value should be true and relevant time should be required.
please suggest me any easy way.
Thanks