Entity Framework and Code First Development RRS feed

  • Question

  • Microsoft releases Entity Framework 4.0 and in it developers can do Code First Development. This is fine and thanks to Microsoft.

    I have one confution about code first development. I have worked on Entity Framework in ASP.NET 3.5 SP1 and Visual Studio 2008 SP1. In that we create a database schema and from that we create Entity Data Model. That means we are creating our class model from database. I think this is called data first development.

    But when we create Entity Data Model in Entity Framework 3.5 SP1 then there are two options. First is Generate from existing database and another is create a blank model. Suppose I create a blank model and then map it to the database. So we first develop the class models without thinking the database schema and then map it with database. My confution is, is it called code first deveopment? Then why the community people and books are saying that 'It is not possible to impliment code first development in Entity Framework 3.5 SP1'?

    To solve my confution I need your help. So please give reply on this post.

    Thank you.

    Tuesday, November 29, 2011 9:27 AM


  • Hi,

    You have "code first" (code is your model), "model first" (you start to create a model from which you'll create a db) and "database first" (you create a model from your existing db).

    Try http://msdn.microsoft.com/en-us/library/aa139632.aspx for details (Entity Framework Documentation).

    Please always mark whatever response solved your issue so that the thread is properly marked as "Answered".
    Tuesday, November 29, 2011 11:46 AM