Fluent API Class Hierarchy

The below image shows hierarchy of important Fluent API classes:

fluent api

As you can see, I have separated classes by levels eg. DbModelBuilder is a level 0 class because it's the main class in Fluent API configuration. EntityTypeConfiguration is a Level 1 class because we can set relationship between entities using this class. ManyNavigarionConfiguration, OptionalNavigationPropertyConfiguration and RequiredNavigationPropertyConfiguration are Level 2 classes which set some additional configuration between entities.

So, Level 1 and Level 2 classes can be used to configure relationship between the entities, which will be mapped to database tables. Level 3 & 4 can be used to configure additional mapping between the entities.

The next few chapters will explain how to use these classes to configure One-to-One, One-to-Many and Many-to-Many relationships using these classes.