Click here to Skip to main content
15,893,814 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Quote:
I am using Code first model in my asp.net mvc 4 application with DbContext. Currently, I am using simple Add, Update and Delete and Find methods of DbContext class.
But I want to use stored procedures to add, update, delete and find the data so that whenever we do some minor changes in the database. I don’t want to recompile and publish the whole application whenever some minor changes occur in the database. Suppose we add some column or rename the column and table name, we also need to do changes in the model structure.
Can you tell me the better way to handle it and how to achieve this?
Is using stored procedure with Entity framework code first model is a better way?
If we are using database first model, the same problem arising that we need update the model from database and recompile and publish it?
Please reply ASAP.
Thanks.
Posted

Hi , firts of all read take a quick look at this article :
SP in EF CF
 
Share this answer
 
Although you can use stored procedures with EF, but then what is the objective of using a model that was created keeping in view that it will bridge the gap between relational model and object oriented programming? However it is rare that you change datatypes and columns of the database after the architecture has already been drawn. In your case if you frequently change the architecture of your database, do not use EF. Go for ADO.Net. Still, a change in the architecture of database will make you update your business layer, and database layer. So, either way you have to make adjustment.
 
Share this answer
 

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