[Range(typeof(DateTime), DateTime.Now.AddYears(-65).ToShortDateString(), DateTime.Now.AddYears(-18).ToShortDateString(),ErrorMessage="aaa")]
public DateTime Birthday { get; set; }
我想对时间范围进行验证,但这种写法编译出错
错误:
特性实参必须是特性形参类型的常量表达式、typeof表达式或数组表达式。
梵蒂冈之花
随时随地看视频慕课网APP