In one of my latests post I wrote about Hybrid Code First . When I started to write about it I realised that it is not very clear and transparent what does Code First, Database First and Model First are and what are differences between them. The main scope of this post is to define in a few words each of this mechanisms and what are the main difference between them. Code First - Define the domain first in code. Based on this domain, the database will be created on the fly by Entity Framework. This approach is used very often in combination with DDD (Domain Driven Development) Database First - Define the database schema first. Based on it, EF generates the code that maps the database to our entities and the access mechanism Model First - Define the model in a design tool. Based on this design, EF will generate the entities and the database structure that is needed Now, that we know what are the available mechanism to define and map our model, let's see what are the...
DREAMER, CRAFTER, TECHNOLOGY ENTHUSIAST, SPEAKER, TRAINER, AZURE MVP, SOLVING HARD BUSINESS PROBLEMS WITH CUTTING-EDGE TECHNOLOGY