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.
this is very similar to retrieve-custom-attribute-parameter-values, i'd use it as a basis for your solution
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With