I would like to store DataAnnotations inside a database. How can I retrieve a string representation of a DataAnnotation by reflection (or by other means)?
Example
public class Product
{
[DisplayName("Price")]
[Required]
[RegularExpression(@"^\$?\d+(\.(\d{2}))?$")]
public decimal UnitPrice { get; set; }
}
Result could be XML or JSON data as long as it is stringified.