M
M
mindgrow2018-04-30 17:49:11
SQL
mindgrow, 2018-04-30 17:49:11

Is there any benefit in partially migrating from EntityFramework to sql queries?

Good afternoon!
To optimize the asp mvc application, in some controller methods I plan to replace calls to the database through EF with calls through sql queries. Will it speed up the site?
It is doubtful that in some other controller actions, work with the database will remain implemented through EF and the assembly will be loaded anyway.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
eRKa, 2018-04-30
@kttotto

For optimization - makes sense, it will really speed up complex queries. There is no difference in how many ways you will get data from the database in the controller. The assembly will load once, and if it hangs idle, the weather will not do it. You can make an additional layer of the Repository between the database and the controller and create methods inside that will be at least through EF, at least through ADO.NET, or through something else to get data.

E
Evgeny, 2018-04-30
Maltsev @loqiue

Hey! You can look at the EF+Dapper hybrid solution .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question