I would like to store DataAnnotations inside the database. How can I get a string representation of a DataAnnotation by reflection (or in other ways)?
Example
public class Product
{
[DisplayName("Price")]
[Required]
[RegularExpression(@"^\$?\d+(\.(\d{2}))?$")]
public decimal UnitPrice { get; set; }
}
The result may be XML or JSON data, if built.
W3max source
share