Change Table and Column Name Mappings Entity Framework v4.3

后端 未结 1 1578
無奈伤痛
無奈伤痛 2020-12-09 10:32

I\'ve got an application with a working Entity model generated from an existing database. I have to point my application at a new database, with the same schema, except that

相关标签:
1条回答
  • 2020-12-09 11:12

    You can change the database in the web.config file.

    Use data annotations to use the different table and column names.

    For example:

        [Table("tblAnswer")]
        class Answer
        {
          [Column("zAnswerId")]
          public int AnswerId { get; set; }
        }
    
    0 讨论(0)
提交回复
热议问题