Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6713387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:22:29+00:00 2026-05-26T08:22:29+00:00

I have some basic knowledge of Entity Framework 4.1 Code First, but haven’t used

  • 0

I have some basic knowledge of Entity Framework 4.1 Code First, but haven’t used this in a production application yet. I am in the architecture phase of a web app and have made no firm commitments to a DAL except that Entity Framework will be used. I have not decided which EF approach: Model First, Database First, or Code First. I was wondering how suitable Code First, or the other two, would be for this scenario. Which of the 3 approaches would work best?

Here is the scenario:

  • Developer does not have DBO permissions on the production database server. This means that the developer cannot run their own DDL/DML commands or scripts directly on the server. Instead, the DBA would have to execute the DDL/DML commands.
  • The model is expected to change over time, even after the database comes into existence. This means that if using Code First, the database would have to be dropped. To my knowledge, there is no way around this with Code First, and there is not out-of-the box means I know of, with the Code First framework, to maintain the data across re-modelings and drops. Would the DB be dropped in the case of Database First or Model First?

It would be great if you have had experience with a similar situation such as mine.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:22:30+00:00Added an answer on May 26, 2026 at 8:22 am

    Point 1 could be solvable by: Developer writes script, Developer gives script to DBA, DBA runs script 🙂

    Point 2:

    You don’t need to drop the database in Code-First. The usual way in production is to switch off the database initializer (they are mainly meant for development phase only anyway):

    Database.SetInitializer<MyContext>(null);
    

    This way your application doesn’t touch the database schema at runtime. You will get exceptions though if your model doesn’t match the database schema anymore. To migrate to a new schema, you would have to change the schema manually or by scripts (give it to the DBA) to match your changes in the model.

    For Database-First approach you have to do the same. And for Model-First too, I believe, because the scripts which Model-First creates by default start with dropping the existing database. None approach creates change scripts for you which only update an existing database schema. They always create the schema from scratch.

    So, in my opinion the points you mentioned are not a reason to decide in favor or against Code-First.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some basic knowledge of Mod Rewrite, but I can't figure this out!
I have some basic idea on how to do this task, but I'm not
I have some basic knowledge about compiling C but need to get a couple
I'm quite new to C++ but have some basic C knowledge. In my past
I'm new with C#, I have some basic knowledge in Java but I can't
I am new to C++ but I have some basic memory allocation knowledge in
I have some knowledge about Human computer interaction and some basic knowledge programming scripts
I have some basic PHP code: $raceramps56[short] = My Test Product; $leftMenu = '<div
I have a VC++ application and in my application i have some basic file
Currently, I have some basic code to play a simple tone whenever a button

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.