In our asp.net mvc forms we will typically add attributes to our view model properties such as DisplayName, Description and Required.
We'll then just call Html.EditorFor(model => model.PropertyName) for each property.
I now have a situation where I don't have a strongly typed viewmodel to which I can apply such attributes. Instead I have a list of the following class:
public class AttributeValue
{
public string Name { get; set; }
public string Description { get; set; }
public bool Required { get;set; }
public object AttributeValue { get; set; }
}
How can I add the meta data manually using the information stored in the above class, so that the EditorFor helper and validation still works?