Adding Client Validation To DataAnnotations DataType Attribute
- by srkirkland
The System.ComponentModel.DataAnnotations namespace contains a validation attribute called DataTypeAttribute, which takes an enum specifying what data type the given property conforms to. Here are a few quick examples: public class DataTypeEntity
{
[DataType(DataType.Date)]
public DateTime DateTime { get; set; }
…