Geeks With Blogs
Zakaria's Blog

EF developer workflows

There are different ways we can use our entity framework to access relational database using classes in  our .NET application.

Entity Framework supports four basic development workflows,all workflows are equivalent.Couple of simple topics are helpful to find a suitable workflow :

   

  • We are targeting a new database that is a database doesn't exist or an empty database
  • or targeting an existing database that is already being created and populated with tables

      and

  • We create a model that is boxes in line in a designer 
  • or write code

Model First(New Database)

  • In model first we are using boxes in line in a designer for model first
  • We can then generate a database from the model
  • Classes that we are going to interact with our application is generated for us based on the boxes in line that we draw in the designer.


Database First

  • In database first the boxes in line the reverse engineer boxes in line model using in the designer
  • Classes will interact with our .NET application automatically generate for us based on the boxes in line


Code First (new database)

  • In this workflow we define our model using code that is interact with our applications
  • and optionally we can supply some additional mapping and configuration code for further specification of the model
  • again the database is created for us from the model

If we change our model then we can use code first migration to evolve the database.

Code First (existing database)

In this task we find our model using code and this time it's mapping to an existing database

There is some also some tools we can use to reverse engineer my this ,model for me




Posted on Sunday, February 10, 2013 11:37 PM entity framework | Back to top


Comments on this post: Entity Framework

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © A.K.M. Zakaria | Powered by: GeeksWithBlogs.net