在MVC应用程序中,我正在使用Entity Framework来实现这个简单的模型:
public class Product
{
public Guid ProductID { get; set; }
[Required]
[StringLength(50, MinimumLength = 1)]
[Display(Name = "Product name")]
public string ProductName { get; set; }
[Required]
[Display(Name = "Download URL")]
[DataType(DataType.Url)]
public string DownloadUrl { get; set; }
[Display(Name = "Download counter")]
public int DownloadCounter { get; set; }
}
我自动拥有脚手架页面并有两个问题: