实体框架安全吗? [英] is Entity Framework secure?

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

问题描述

我正在努力创建一个具有3层架构的asp.net c#网站

我的问题是:使用Entity Framework有什么好处,是否有必要

或者我应该继续使用经典的ado.net??

i'm tryin to create an asp.net c# website with 3 tier architecture
my question is: What are the benefits of using Entity Framework and is it necessar
or should i keep using the classic ado.net??

推荐答案

你必须检查并阅读这个链接。

安全注意事项(实体框架)[ ^ ]
You must check and read this link.
Security Considerations (Entity Framework)[^]


是的,这是安全的。作为与数据库交互的先进方式,最好使用它。

以下是EF的一些好处:

为CRUD操作提供专用功能(创建,读取,更新,删除)。易于实施CRUD操作。



>>如果您想要替换数据存储,则可以在不修改数据访问逻辑的情况下轻松替换,因为所有数据访问逻辑都存在于更高级别。



> >易于管理表格之间的一对一,一对多和多对多的关系。



>>概念模型可以更好的方式表示。



>>开发人员可以减少类和子类中的代码以进行数据访问。
Yes, this is secure. As its advance way of interacting with database it will be better to use this.
Here are some benefits of EF:
Provides dedicated functionality for CRUD operation (Create, Read, Update, Delete). Easy to implement CRUD operations.

>> If you want to replace the data store, it is very easy to replace without modifying the data access logic since all data access logic are present in higher level.

>> Easy to manage one to one, one to many and many to many relationship between tables.

>> Conceptual model can be represented in a better way.

>> Developer can reduce the code in classes and sub-classes for data access.


没有必要使用实体框架,您可以继续使用经典的ado.net。实体框架不是ado.net的替代品,实体框架也在幕后使用ado.net。



主要优点是

1.管理代码很容易,特别是在处理企业应用程序时。



2.您必须为常规数据库操作编写更少的代码。相反,实体框架将完成大部分工作,您可以专注于主应用程序逻辑。



请注意,使用实体框架不会获得任何性能优势。它还使用ado.net作为其基础层。因此,使用经典的adp.net技术调用存储过程等将比在其间具有额外的实体框架层更快。
It is not a necessary to use entity framework, you can keep using the classic ado.net. Entity framework is not a replacement of ado.net, entity framework also uses the ado.net behind the scenes.

The main advantages are
1. It is easy to manage the code, especially when you are working on enterprise applications.

2. You will have to write less code for regular database operations. Instead entity framework will do most of this stuff and you can concentrate on your main application logic.

Note that you will not get any performance benefits by using entity framework. It also uses ado.net as its base layer. So calling stored procedures etc. using classic adp.net techniques will be faster as compared to having an extra entity framework layer inbetween.


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

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