I have a model like this
public class MyModel
{
public int MyModelId { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string Title { get; set; }
}
I was wondering if there's a way, using Data Annotations, to set the value of a property - say Title - default to other property value, i.e. Name. Something like:
if(MyModel.Title == "") MyModel.Title = MyModel.Name;