Click here to Skip to main content
15,887,822 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I am working on project in which we are going to use MVC 4.5 and Entity Framework6.

There are some doubts in my mind that are;
1. Can we use stored Procedure with Entity framework. Because there is a scenario where we insert
and update data in multiple tables on single button click which could easily achieved using a
stored procedure on one hit on the Database. If we do not use stored procedure then we have to
hit database many times.
Is there any better alternative in entity framework for this scenario only.

2. Can we upload our project on the server without publishing it. Because in our case small
changes frequently take place and we have to upload a single page many times on the server for
a small change. If not then please suggest a better alternative of it.

Regards,
Ashish verma
Posted

1.yes..you can use stored procedure in entity frame work.but in the case of simple CRUD operations,entity method is more efficient

Entity Framework CRUD Operations Using Stored Procedures[^]



2.yes..you can copy that particular file only n paste in web server
 
Share this answer
 
v2
Comments
Aashish vermaa 19-Aug-14 4:24am    
In that case where changes take places in view, controller and model as well.
NowYouSeeMe 20-Aug-14 5:06am    
http://www.entityframeworktutorial.net/stored-procedure-in-entity-framework.aspx
1. usually i use a generic repository (search for repository pattern) you could implement a InsertOrUpdate method in your repository and make it available across every entity, you don't need to create one SP for entity.

2. you can publish your files and look for the ones that have last edit time grater than the version of the server, for example for changes on .cshtml / .config / .js files you can upload the modified file, if you changed the model / controller you need too upload only the .dll that contains that specific class
 
Share this answer
 
v3

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