Razor movie模型

 1 public class Movie
 2 {
 3     public int ID { get; set; }
 4 
 5     [StringLength(60, MinimumLength = 3)]
 6     [Required]
 7     public string Title { get; set; }
 8 
 9     [Display(Name = "Release Date")]
10     [DataType(DataType.Date)]
11     public DateTime ReleaseDate { get; set; }
12 
13     [Range(1, 100)]
14     [DataType(DataType.Currency)]
15     [Column(TypeName = "decimal(18, 2)")]
16     public decimal Price { get; set; }
17 
18     [RegularExpression(@"^[A-Z]+[a-zA-Z""'\s-]*$")]
19     [Required]
20     [StringLength(30)]
21     public string Genre { get; set; }
22 
23     [RegularExpression(@"^[A-Z]+[a-zA-Z0-9""'\s-]*$")]
24     [StringLength(5)]
25     [Required]
26     public string Rating { get; set; }
27 }

猜你喜欢

转载自www.cnblogs.com/agetoage/p/12416083.html