且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

生成实体框架类和函数

更新时间:2023-02-13 10:38:55

在这里你可以使用EF代码第一种方法或DB第一种方法。但我想建议首先在现有数据库中使用EF代码。您可以查看下面提到的文章以获取更多信息。



代码优先到现有数据库



使用现有数据库使用EFCode First



实体框架代码优先:映射到数据库中的现有表 [ ^ ]



使用Entity Framework 5.0代码优先访问现有数据库



更新



表值函数(TVF)(EF5以上)



我希望这对您有所帮助。
Here you can use either EF code first approach or DB first approach. But I would like to recommend using EF code first with existing database. You can check below mentioned articles for more info.

Code First to an Existing Database

Using EF "Code First" with an Existing Database

Entity Framework Code First: Mapping to Existing Table in the Database[^]

Using Entity Framework 5.0 Code-First to Access an Existing Database

UPDATE

Table-Valued Functions (TVFs) (EF5 onwards)

I hope this will help to you.