|
|
|
@ -142,24 +142,27 @@ Configure<AbpDbContextOptions>(options => |
|
|
|
Add actions for the `ConfigureConventions` and `OnModelCreating` methods of the `DbContext` as shown below: |
|
|
|
|
|
|
|
````csharp |
|
|
|
options.DefaultConventionAction = (dbContext, builder) => |
|
|
|
Configure<AbpDbContextOptions>(options => |
|
|
|
{ |
|
|
|
// This action is called for ConfigureConventions method of all DbContexts. |
|
|
|
}; |
|
|
|
options.ConfigureDefaultConvention((dbContext, builder) => |
|
|
|
{ |
|
|
|
// This action is called for ConfigureConventions method of all DbContexts. |
|
|
|
}); |
|
|
|
|
|
|
|
options.ConfigureConventions<YourDbContext>((dbContext, builder) => |
|
|
|
{ |
|
|
|
// This action is called for ConfigureConventions method of specific DbContext. |
|
|
|
}); |
|
|
|
options.ConfigureConventions<YourDbContext>((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.ConfigureDefaultOnModelCreating((dbContext, builder) => |
|
|
|
{ |
|
|
|
// This action is called for OnModelCreating method of all DbContexts. |
|
|
|
}); |
|
|
|
|
|
|
|
options.ConfigureOnModelCreating<YourDbContext>((dbContext, builder) => |
|
|
|
{ |
|
|
|
// This action is called for OnModelCreating method of specific DbContext. |
|
|
|
options.ConfigureOnModelCreating<YourDbContext>((dbContext, builder) => |
|
|
|
{ |
|
|
|
// This action is called for OnModelCreating method of specific DbContext. |
|
|
|
}); |
|
|
|
}); |
|
|
|
```` |
|
|
|
|
|
|
|
@ -972,4 +975,4 @@ public class MyCustomEfCoreBulkOperationProvider |
|
|
|
|
|
|
|
* [Entities](../../architecture/domain-driven-design/entities.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) |
|
|
|
|