生成实体框架类和函数 [英] Generate Entity Framework class and function

查看:100
本文介绍了生成实体框架类和函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好



我是Entity框架中的新手我有一个数据库,我需要创建类和函数,如保存删除更新



我怎么做?

Hi all

I am new in the Entity framework i have a database and i need to create classes and functions like save delete update

how i can do that ?

推荐答案

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



代码优先到现有数据库



使用现有数据库使用EFCode First



实体框架代码优先:映射到数据库中的现有表 [< a href =http://www.codeproject.com/Tips/661053/Entity-Framework-Code-First-Maptarget =_ blanktitle =New Window> ^ ]



使用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.


这篇关于生成实体框架类和函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆