Reputation: 1354
Base class:
public class XmlNameValueField : XmlBaseField
{
[XmlAttribute("n")]
[Required]
public string Name { get; set; }
[XmlText]
public string Value { get; set; }
}
Child Class:
public class DateField : XmlNameValueField
{
}
In the Child class field Name must have an additional attribute
[DataType (DataType.EmailAddress)]
Upvotes: 4
Views: 2190
Reputation: 38179
You'll need to mark the property as virtual in the base class, override it in the child class and add the attributes.
Upvotes: 1