Entity Framework introduced Code First approach from Entity Framework 4.1. Code First is mainly useful in Domain Driven Design In the Code First approach, you can focus on the domain design and start creating classes as per your domain requirement rather than design your database first and then create the classes which matches your database design. Code First APIs will create the database on the fly based on your entity classes and configuration.
So as a developer, you first start writing C#/VB.net classes rather than focusing on database design and then when you run the application, Code First APIs will create the new database or map your classes with existing database before running your application.
So the basic workflow would be:
Let’s see simple code first example in the next chapter.
No comments:
Post a Comment