In this chapter we’ll explore two of the methods Entity Framework provides to control the schema it creates when you use the Code First workflow.
Although the conventional approach to the Code-First Workflow works quite well, there are almost certainly going to be times when you need to give Entity Framework a little more information. One way to do this is to use DATA ANNOTATIONS, and we’ll start the chapter by exploring how all that works.
If you prefer not to clutter up your classes with information that isn’t directly related to their functionality, the Entity Framework provides another method for controlling the runtime model. You can use the DbContext.OnModelCreating()
method and the Fluent API to configure the database schema.