Click here to Skip to main content
15,851,711 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi,
Is there any way to map single stored procedure for all (insert, update, delete) operations in Entity Framework. As far as i searched i found the ways of mapping individual proceures for each operation. But i have one procedure that does insert, update and delte with options. Pls help to accompish this task.
Thank U All
Posted

1 solution

Having one process that does it all, is a dumb design. It means passing in a parameter to tell it what to do, and having a lot more code than you need, in terms of when you edit it, for one task.

However, when you map to a proc in EF, you don't define what it DOES, you simply expose it as something you call. So, I think you're talking about one of the ( also ridiculous ) ASP.NET controls which you tell what methods to call for CRUD. You're better off taking more control than that, and if you do, if you must, can call the same proc in all instances, and pass in a parameter to tell it which operation you want.

I still think you're better off with one proc/one task though.
 
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