实体框架4对本地Ado.net [英] Entity Framework 4 vs Native Ado.net

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

问题描述

我想知道如何实体框架4相比本土Ado.Net和SP?

I was wondering how does the Entity Framework 4 is compared to native Ado.Net and SPs ?

我会丢失,如果我用正常的Ado.Net?

what i would be missing if i used normal Ado.Net ?

确实值得留下EF4?

推荐答案

在简单地说,EF是一个对象 - 关系映射(ORM)和ADO.Net是原始动力。一个ORM可以让你牺牲一些运行时的性能,易于维护。你获得写code更声明的方式,EX pressing的什么的你想要的数据库,而不是正好的如何的去获得的能力它。其结果是,更改数据库结构可占的映射,而不是在应用程序中的一个需要触动,改变特定的表中的每一个部分。

In a nutshell, EF is an object-relational mapper (ORM), and ADO.Net is raw power. An ORM allows you to trade some runtime performance for ease of maintenance. You gain the ability to write code in a more declarative manner, expressing what you want out of the database instead of exactly how to go about getting it. As a result, changes to the database structure can be accounted for in the mappings rather than in every single part of your application that needed to touch the particular table that changed.

你会怎么,如果你使用的ADO.Net是开发人员的生产力会丢失。描述每个数据库操作详细ADO.Net非常耗时,容易出错,并没有太大的乐趣。

What you would be missing if you use ADO.Net is developer productivity. Describing each database operation in detail to ADO.Net is time consuming, error-prone, and not much fun.

我不认为我会永远想离开的ORM,并回到原ADO.Net除非在极端性能要求的情况下,如导入大量的数据,在这种情况下,你可能会最好写一个SSIS包呢。

I don't think I would ever want to "leave" an ORM and go back to raw ADO.Net except in situations in which extreme performance is required, such as importing large amounts of data, in which case you might be better off writing an SSIS package anyway.

这篇关于实体框架4对本地Ado.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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