Я хочу проверить дату и время, мой код:
[Range(typeof(DateTime),
DateTime.Now.AddYears(-65).ToShortDateString(),
DateTime.Now.AddYears(-18).ToShortDateString(),
ErrorMessage = "Value for {0} must be between {1} and {2}")]
public DateTime Birthday { get; set; }
но я получаю сообщение об ошибке:
An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type
пожалуйста, помогите мне?