concept By Convention in category entity framework

appears as: By Convention
Entity Framework Core in Action

This is an excerpt from Manning's book Entity Framework Core in Action.

For simplicity, we use EF Core’s By Convention configuration approach to model the database. We use EF Core By Convention naming for the properties that hold the primary key and foreign keys in each for the entity classes. In addition, the .NET type of the navigational properties, such as ICollection<Review> Reviews, defines what sort of relationship I want. For instance, because the Reviews property is of the .NET type ICollection<Review>, the relationship is a one-to-many relationship. Chapters 6 and 7 describe the other approaches for configuring the EF Core database model.

  • By Convention —When you follow simple rules on property types and names, EF Core will autoconfigure many of the software and database features. Using the By Convention approach is quick and easy, but it can’t handle every eventuality.