Tuesday, December 10, 2013

Fluent API Class Hierarchy

Below image shows hierarchy of important Fluent API classes:

fluent api

As you can see that I have separated classes by levels eg. DbModelBuilder is level 0 class because it’s main class in Fluent API configuration. EntityTypeConfiguration is 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 that will be mapped to database tables. Level 3 & 4 can be used to configure additional mapping between the entities.

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

No comments:

Post a Comment