Click here to Skip to main content
15,790,723 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Previous I was working on the Asp.Net(C#) with the ADO.Net Web Application, Now i want move on MVC 5. I am totally new in the MVC.

I want to know which one is better in MVC 5, that ADO.Net or Entity Framework ?

What I have tried:

I have not perform any project with the use of MVC architecture.
Updated 15-Apr-16 10:15am

1 solution

Which is better: a speedboat, or a Ferrari? *

Without knowing the intricate details of your project, or your team's experience, capabilities and preferences, there's no way we can tell you which technology is "better".

They're both pretty good, and both perfectly usable in ASP.NET MVC. You'll tend to see more examples using EF than raw ADO.NET, but EF has some drawbacks and limitations. ADO.NET has been pretty stable for the last 15 years, whereas EF has gone through several major shifts in its lifetime.

There are also other ORMs to consider, such as NHibernate[^]; or you might want a "micro-ORM" like Dapper[^].

* And the answer is "a hovercraft". But preferably not one that's full of eels. :)
Share this answer
#realJSOP 4-Feb-19 8:10am    
I know this is almost 3 years old, but...

We have an existing ASP.Net/Javascript/Ajax site that uses ADO, and they're converting it to EF. I am not on board with this because EF has a huge footprint, and 99% of our database access is via stored procs, thus nullifying most benefits that EF provides. Virtually ALL of our stored procs use at least one join of some kind, and there are a lot of CTEs. I see no tangible/useful justification for the switch. I'm in the process of designing a new version of the site with MVC5 and the template insists on adding EF when I select some form of user account. I haven't yet investigated removing EF. IMHO, the juice ain't worth the squeeze.
Richard Deeming 4-Feb-19 8:22am    
Indeed - if you're mostly using stored procedures, EF is a waste of time.

The user accounts are probably using ASP.NET Identity, which uses EF by default. You can get rid of it, but you'll need to write some code. For example:
Exorcising Entity Framework from ASP.NET Identity – Mark Johnson[^] (MVC5)
ASP.NET Core Identity Without Entity Framework – Mark Johnson[^] (.NET Core)
#realJSOP 4-Feb-19 8:46am    
Yeah, I found those links this morning, but they're blocked at work. :/

As an aside, I explored core razor pages, and there's too much dancing around with IIS to make it worth our while. Our app is currently a hyper-delicate house of cards, and converting to core AND mucking around in IIS seems fraught with more danger than I want to personally deal with. Besides, CRaP is still in its infancy, and there's very little in terms of tangible help/examples on the internet right now. However, I do prefer the CRap folder hierarchy to the old MVC5 arrangement.
Richard Deeming 4-Feb-19 8:48am    
Can you get to GitHub? Mark posted a demo of the MVC5 one there:[^]
#realJSOP 4-Feb-19 8:51am    
I don't want to use an ORM of any kind. Isn't that what Dapper is?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900