diff --git a/docs/en/Entity-Framework-Core.md b/docs/en/Entity-Framework-Core.md index cb9393b1aa..73efe7970a 100644 --- a/docs/en/Entity-Framework-Core.md +++ b/docs/en/Entity-Framework-Core.md @@ -139,6 +139,30 @@ Configure(options => }); ```` +Add actions for the `ConfigureConventions` and `OnModelCreating` methods of the `DbContext` as shown below: + +````csharp +options.DefaultConventionAction = (dbContext, builder) => +{ + // This action is called for ConfigureConventions method of all DbContexts. +}; + +options.ConfigureConventions((dbContext, builder) => +{ + // This action is called for ConfigureConventions method of specific DbContext. +}); + +options.DefaultOnModelCreatingAction = (dbContext, builder) => +{ + // This action is called for OnModelCreating method of all DbContexts. +}; + +options.ConfigureOnModelCreating((dbContext, builder) => +{ + // This action is called for OnModelCreating method of specific DbContext. +}); +```` + If you have a single `DbContext` or you have multiple `DbContext`s but want to use the same DBMS and configuration for all, you can leave it as is. However, if you need to configure a different DBMS or customize the configuration for a specific `DbContext`, you can specify it as shown below: ````csharp