I have a couple model classes like so:
public class MyModelBase
{
public string Name { get; set; }
}
public class MyModel : MyModelBase
{
public str
I note that none of these answers actually call the base Name property correctly. The override should write something like the following, in order that you don't have a separate value for the new property.
public class MyModelBase
{
public virtual string Name { get; set; }
}
public class MyModel : MyModelBase
{
[Required]
public override string Name { get { return base.Name; } set { base.Name = value; }
public string SomeOtherProperty { get; set; }
}