Browse Source

configure via ConfigureDefaultConvention() and ConfigureDefaultOnModelCreating().​

The DefaultConventionAction and DefaultOnModelCreatingAction properties have internal access modifiers and cannot be accessed directly. They can only be configured through the ConfigureDefaultConvention() and ConfigureDefaultOnModelCreating() methods.
pull/22951/head
ivan132 1 year ago
committed by GitHub
parent
commit
cf1394540c
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 10
      docs/en/framework/data/entity-framework-core/index.md

10
docs/en/framework/data/entity-framework-core/index.md

@ -142,20 +142,20 @@ Configure<AbpDbContextOptions>(options =>
Add actions for the `ConfigureConventions` and `OnModelCreating` methods of the `DbContext` as shown below: Add actions for the `ConfigureConventions` and `OnModelCreating` methods of the `DbContext` as shown below:
````csharp ````csharp
options.DefaultConventionAction = (dbContext, builder) => options.ConfigureDefaultConvention((dbContext, builder) =>
{ {
// This action is called for ConfigureConventions method of all DbContexts. // This action is called for ConfigureConventions method of all DbContexts.
}; });
options.ConfigureConventions<YourDbContext>((dbContext, builder) => options.ConfigureConventions<YourDbContext>((dbContext, builder) =>
{ {
// This action is called for ConfigureConventions method of specific DbContext. // This action is called for ConfigureConventions method of specific DbContext.
}); });
options.DefaultOnModelCreatingAction = (dbContext, builder) => options.ConfigureDefaultOnModelCreatingAction ( (dbContext, builder) =>
{ {
// This action is called for OnModelCreating method of all DbContexts. // This action is called for OnModelCreating method of all DbContexts.
}; });
options.ConfigureOnModelCreating<YourDbContext>((dbContext, builder) => options.ConfigureOnModelCreating<YourDbContext>((dbContext, builder) =>
{ {
@ -972,4 +972,4 @@ public class MyCustomEfCoreBulkOperationProvider
* [Entities](../../architecture/domain-driven-design/entities.md) * [Entities](../../architecture/domain-driven-design/entities.md)
* [Repositories](../../architecture/domain-driven-design/repositories.md) * [Repositories](../../architecture/domain-driven-design/repositories.md)
* [Video tutorial](https://abp.io/video-courses/essentials/abp-ef-core) * [Video tutorial](https://abp.io/video-courses/essentials/abp-ef-core)

Loading…
Cancel
Save