Reputation: 46591
I have an MVC app that has inline SQL all over the place. I am currently using MySQL and was curious if it would be a good idea to move the inline sql into functions or routines. This way, if it needed to be changed, I would just have to change the routine or function at the database level instead of at the code level which would require a new build. Is there an alternative approach?
Upvotes: 0
Views: 156
Reputation: 1062
It is better to keep your sql statements out of c# code. There are couple of advantages,
Also you could try EntityFramework as an alternate, where you don't need to bother about sql statements
Upvotes: 1