Stored Proc X Entity - Is this a good decision?

Asked

Viewed 123 times

2

On Entity Framework days, is doing an MVC project using Stored Procedure a good way forward? I have always heard this: If you opt for RU it makes no sense to use SP, but I have heard people say that this is not necessarily an absolute truth. Then comes the question: SP X EF can use both worlds or not? It is not a broad question and does not receive many opinions. The answer would be to use both or not in an MVC architecture.

  • It depends on how you plan to use Storedprocedure. No, it is not good practice, since you "kill" LINQ and EF. In fact, when choosing not to use EF, a good option is to use ADO.NET.

  • The question was not this and yes, if there is possibility to work with the two and MVC together. As for what you said and thank you, it is as I posted. Today I have used a lot Ado.Net and in a way that a friend who taught it has been pretty cool, but only when I use Webforms. With MVC I have used EF, but as I have a project in Webforms q I would like you to migrate to MVC, so I got the initial question, since everything is in SP. It would give less work to migration, rs.

  • What do you want to know exactly? Do you want to know if you can use both together with MVC?? Yes, it does... it goes according to the needs of the project. But I do not consider it a good practice not...you can do everything for EF and LINQ....

1 answer

4


On Entity Framework days, do an MVC project using Stored Procedure is a good way?

Not.

The purpose of the Entity Framework for development is to save programming effort by modeling the database as a tailor, adjusting it perfectly to the application code, with the best possible practices of database normalization. With this, it is expected that queries are also optimized by following a natural standard of bank design.

Putting Stored Procedures, you would be wasting all this work that the Framework does it for you. Unless much special attention needs to be paid to safety, after ready, it may be interesting to make the system perform the access by Stored Procedures. I explain all this in this answer.

  • no exceptions? even in slow consultations, tunning purpose?

  • 1

    In version 6 this was well improved. Tuning can be done by adding some indices, not by Stored Procedures.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.