Convert and modify a model field as an DataColumn object

后端 未结 1 1539
旧巷少年郎
旧巷少年郎 2021-01-26 15:11

In ASP.NET MVC 3 I would like to access at database creation time the model fields as if they were objects of DataColumn class, so that I could then modify the auto-increment se

1条回答
  •  孤城傲影
    2021-01-26 16:01

    This might what you need

    public class MyModel
    {
        [Key]
        [DatabaseGenerated(System.ComponentModel.DataAnnotations.DatabaseGeneratedOption.None)]
        public int MyID { get; set; }
    }
    

    0 讨论(0)
提交回复
热议问题