Is there a way to have class names be different from your table names?

前端 未结 2 2030
栀梦
栀梦 2020-12-19 10:18

We are using a database created several years ago, and would like to keep the table names the same.

All of our tables are named like: \"tbl_Orders\" but we would l

2条回答
  •  北荒
    北荒 (楼主)
    2020-12-19 10:43

    You can use the Table attribute or the fluent api to map between table names in your database and class names

    [Table("tbl_Blogs")] 
    public class Blog
    

提交回复
热议问题