基本验证与业务验证,基本验证就是始终保持不变的验证规则,可以通过如下硬编码实现: public class Order { [Required] [Range(")] public decimal Price { get; set; } [Required] [StringLength()] public string Customer { get; set; } [Required(AllowEmptyStrings=true)] [StringLength()] public string…