实体框架的好处是什么? [英] What are the benifits of entity Framework?

查看:87
本文介绍了实体框架的好处是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道实体框架有什么好处?

为什么使用它。

I wanted to know What are the benifits of entity Framework?
why it is used.

推荐答案

我发现以下是Entity Framework的一些优点:



1)实体框架处理代码与数据库交互的核心复杂性。您不需要直接将代码写入数据库,而是写入场景后面的Context与数据库交互。



2)它处理SQL注入漏洞攻击。如果您正在使用EF,那么您可以确信SQL注入攻击的可能性几乎为零。



3)您可以编写LINQ查询,这肯定会降低代码复杂性并且代码也会更清洁。



4)未来的维护将更容易。它可以轻松适应数据库的变化。例如,如果要在一个表中重命名列,则无需在每个位置更改代码。如果您可以使用model属性更改相应列的列映射,那么它将无缝地工作。



5)当您向EF编写代码时,它提供了智能感知和也可以在编译时验证代码。



希望它有所帮助。
I found the followings are some of the advantages of Entity Framework:

1) Entity Framework handles to core complexity of interaction of code with database. You don't need to write code directly to database, rather you write to the Context which behind the scene interacts with database.

2) It handles the SQL injection vulnerability attack. If you are using EF then you are assured that there is almost zero possibility of SQL injection attack.

3) You can write LINQ queries which definitely will reduce the code complexity and also the code will be little cleaner.

4) The future maintenance will be easier. It easily adapts the database changes. For example, if you are renaming a column in one table, then you don't need to change your code in every places. If you can change the column mapping for the corresponding column with the model property then it will work seamlessly.

5) When you write code to EF, it provides intellisense and also validates the code in compile time.

Hope it helps.


在这里你可以找到一些基本且易于理解的实体框架优势

http://www.dotnetspan.com/ 2014/07 / entity-entity-framework.html [ ^ ]
Here you can find some basic and easy to understand Entity Framework Advantages
http://www.dotnetspan.com/2014/07/advantage-of-entity-framework.html[^]


这篇关于实体框架的好处是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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