Public Class Duration
{
[Required]
Public DurationUnit Unit
[Required]
Public int Length
}
Public Class Employee
{
[RequiredAttribute]
public virtual Duration NotificationLeadTime { get; set; }
}
The fields Unit and Length, when not suplied are getting highlighted in Red but the error message is not getting displayed.
I tries also giving [Required(ErrorMessage="sadfdsf")],but this is also not working.
I also tried inheriting the class with IValidatableObject but that also didn't work.
How to display the error message ?