简体   繁体   中英

Which is the best Scenario for getting data from Database (Entity Framework or Ado.Net) in a .net Core application?

我开始在.net Core上工作,因此哪种方法是使用Entity Framework或Ado .Net从数据库中获取数据的最佳方法?

Actually Entity Framework is build at the top of ADO.NET so it can't be faster. But it makes development much faster. And improves maintainability of your code. I mean the power of LinQ queries with EF requires you to write less code.code is auto generated whereas Ado.net code is larger than Entity Framework.Entity Framework is a wrapper for ADO.NET. Thus there is nearly no difference between those two in performance (maybe entity framework is a bit slower).

If you want to know the details, managing connections, CRUD, and so on, Ado.Net is as good a place to start as any. Once you learn that, you'll probably pick up EF more quickly.

In the end, everything uses SQL at some level. If you're familiar with SQL you'll find it easier using any db framework

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM