In this chapter we’ll explore the last of the three workflows that the Entity Framework supports: Code First.
A basic model using the Code First Workflow is much simpler to implement than the Designer-based workflows, so we’ll start by building one.
The simplest way to set up Entity Framework using the Code First Workflow is to let it make assumptions based on the structure of your classes and their field names. The conventions are straightforward, and this approach will often work for you just fine, so we’ll start by exploring this method.
Although the conventions work well in most situations, there are times the default behavior won’t suit you. We’ll explore controlling the database schema in the next chapter, but one of the first things you’ll probably want to take control of is when and where the database gets created. We’ll explore some techniques for doing that at the end of this chapter.