Write Sql stored procedure with EF code first approach?

preno 60 Reputation points


I am new with EF6 and I'm doing some tests with the ASP.NET MVC 5 and Code First.

As a beginner, I’m confused.

If I create model classes and then have the database (sqlserver) created by EF, can I then write stored procedures in the sqlserver database? I mean with Sql Server Management Studio.

If I change the sql server instance (for example from development to production ) do I have to rewrite them on the new sqlserver?

Entity Framework 6.0
Entity Framework 6.0
A Microsoft open-source object-database mapper for .NET.
243 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
9,798 questions
0 comments No comments
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 36,026 Reputation points

    Yes. You will need to recreate them. You can manually add them, or create c# code to create them and add to the EF on model creating.

0 additional answers

Sort by: Most helpful