I have the following architecture:
public abstract class ApplicationDriverFormAbstractVM : IValidatableObject
{
[Display(Name = "Job applied For")]
public virtual string JobAppliedFor { get; set; }
[Display(Name = "Has any license, permit, or privilege ever been suspended, revoked, or denied?")]
public virtual bool? HasDeniedLicenses { get; set; }
[Display(Name = "Have you ever been convicted for driving under the influence of drugs or alcohol?")]
public virtual bool? HasAlcohol { get; set; }
[Display(Name = "Have you ever tested positive or refused to test on any pre-employment drug and / or alcohol test administered by an employer to which you applied for but did not obtain safety sensitive transportation work covered by DOT agency drug and alcohol testing rules during the past 2 years?")]
public virtual bool? HasDOTAlcohol { get; set; }
[Display(Name = "Have you ever been convicted of a felony or misdemeanor?")]
public virtual bool? HasFelony { get; set; }
public class ApplicationDriverEditVM : ApplicationDriverFormAbstractVM
{
[Required]
public override string JobAppliedFor { get; set; }
[Required]
public override bool? HasDeniedLicenses { get; set; }
[Required]
public override bool? HasAlcohol { get; set; }
[Required]
public override bool? HasDOTAlcohol { get; set; }
[Required]
public override bool? HasFelony { get; set; }
}
but this [Required] attribute does not work on client side. If I remove inheritance and have only one class with [Required] attributes it works fine. Why so?