相关疑难解决方法(0)

在哪里放置数据注释标签?

我正在使用专业的 asp.net mvc 2.0 框架,似乎他将他的数据注释标签放在也生成 linq 到 sql 的类上。

  [Table(Name = "Products")]
    public class Product
    {
        [HiddenInput(DisplayValue = false)]
        [Column(IsPrimaryKey = true, IsDbGenerated = true, AutoSync = AutoSync.OnInsert)]
        public int ProductID { get; set; }

        [Required(ErrorMessage = "Please enter a product name")]
        [Column] public string Name { get; set; }

        [Required(ErrorMessage = "Please enter a description")]
        [DataType(DataType.MultilineText)]
        [Column] public string Description { get; set; }

        [Required]
        [Range(0.01, double.MaxValue, ErrorMessage = "Please enter a positive price")]
        [Column] public decimal Price { …
Run Code Online (Sandbox Code Playgroud)

c# linq-to-sql asp.net-mvc-2

2
推荐指数
1
解决办法
1302
查看次数

标签 统计

asp.net-mvc-2 ×1

c# ×1

linq-to-sql ×1