C# – Entity framework vs pure ado .net in calling stored procedure in an enterprise project

asp.net-mvc-web-apicentity-frameworksql server

There is an enterprise project, which all the business implemented in databases and in the stored procedures, and web API is just like a light wrapper which get the request and deliver it to proper SQL server sp and return the returned response from SQL server to client.

(except some discussions, and pros and cons of this kind of implementation which had discussed before here and here ), what is the best way of calling sp for a project with hundreds of request per second : with entity framework or with ado.net or there is not a huge difference between them?

Best Answer

You can call sprocs via EF no problem, and I expect the speed is going to be comparable.

The question is why would you? The benefit of EF is the automatic mapping of tables to classes and vice versa.

When you us sprocs you bypass all that and indeed for the kind of microsevice api you are talking about you don't tend to have the long persistence and manipulation of objects anyway.

EF is/was sold as the M of MVC, making database interaction without having to learn SQL and muck around with datasets and adaptors.

But for enterprise level stuff where you want to tweak the SQL execution plans, separate out responsibility to a DBA team etc its not always a good fit.