0

I am using code-first approach in Entity Framework v6.1.3.

My question is: I am using a code-first approach, should I also inject the stored procedures through my entities or should I just go to my database and create a stored procedure there?

What will be the best method to address the same?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
cpr43
  • 2,942
  • 1
  • 18
  • 18

1 Answers1

2

You are using code first, do not create stored procedures. The point of switching to a ORM is to move away from manually adding code directly into SQL. Entity framework provides a way to use existing stored procedures so you don't have to rewrite an entire database but you should move away from creating new stored procedures and keep your business logic where it has always belonged, in the application.

Stephen Brickner
  • 2,584
  • 1
  • 11
  • 19
  • thanks stephen ... actually i did it througth the code ..but due to the large number of records involved it was suggested to me that i use Stored Procedure .. hence the query.. – cpr43 Jul 20 '15 at 12:41