Документация
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
## Pf2eDbContext\.OnModelCreating\(ModelBuilder\) Method
|
||||
|
||||
Override this method to further configure the model that was discovered by convention from the entity types
|
||||
exposed in [Microsoft\.EntityFrameworkCore\.DbSet<>](https://docs.microsoft.com/en-us/dotnet/api/Microsoft.EntityFrameworkCore.DbSet-1 'Microsoft\.EntityFrameworkCore\.DbSet\`1') properties on your derived context\. The resulting model may be cached
|
||||
exposed in [Microsoft\.EntityFrameworkCore\.DbSet<>](https://learn.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.dbset-1 'Microsoft\.EntityFrameworkCore\.DbSet\`1') properties on your derived context\. The resulting model may be cached
|
||||
and re\-used for subsequent instances of your derived context\.
|
||||
|
||||
```csharp
|
||||
@@ -14,7 +14,7 @@ protected override void OnModelCreating(Microsoft.EntityFrameworkCore.ModelBuild
|
||||
|
||||
<a name='Pf2e.Database.Pf2eDbContext.OnModelCreating(Microsoft.EntityFrameworkCore.ModelBuilder).modelBuilder'></a>
|
||||
|
||||
`modelBuilder` [Microsoft\.EntityFrameworkCore\.ModelBuilder](https://docs.microsoft.com/en-us/dotnet/api/Microsoft.EntityFrameworkCore.ModelBuilder 'Microsoft\.EntityFrameworkCore\.ModelBuilder')
|
||||
`modelBuilder` [Microsoft\.EntityFrameworkCore\.ModelBuilder](https://learn.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.modelbuilder 'Microsoft\.EntityFrameworkCore\.ModelBuilder')
|
||||
|
||||
The builder being used to construct the model for this context\. Databases \(and other extensions\) typically
|
||||
define extension methods on this object that allow you to configure aspects of the model that are specific
|
||||
@@ -22,7 +22,7 @@ to a given database\.
|
||||
|
||||
### Remarks
|
||||
|
||||
If a model is explicitly set on the options for this context (via [Microsoft\.EntityFrameworkCore\.DbContextOptionsBuilder\.UseModel\(Microsoft\.EntityFrameworkCore\.Metadata\.IModel\)](https://docs.microsoft.com/en-us/dotnet/api/Microsoft.EntityFrameworkCore.DbContextOptionsBuilder.UseModel#Microsoft_EntityFrameworkCore_DbContextOptionsBuilder_UseModel_Microsoft_EntityFrameworkCore_Metadata_IModel_ 'Microsoft\.EntityFrameworkCore\.DbContextOptionsBuilder\.UseModel\(Microsoft\.EntityFrameworkCore\.Metadata\.IModel\)'))
|
||||
If a model is explicitly set on the options for this context (via [Microsoft\.EntityFrameworkCore\.DbContextOptionsBuilder\.UseModel\(Microsoft\.EntityFrameworkCore\.Metadata\.IModel\)](https://learn.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.dbcontextoptionsbuilder.usemodel#microsoft-entityframeworkcore-dbcontextoptionsbuilder-usemodel(microsoft-entityframeworkcore-metadata-imodel) 'Microsoft\.EntityFrameworkCore\.DbContextOptionsBuilder\.UseModel\(Microsoft\.EntityFrameworkCore\.Metadata\.IModel\)'))
|
||||
then this method will not be run. However, it will still run when creating a compiled model.
|
||||
|
||||
See [Modeling entity types and relationships](https://aka.ms/efcore-docs-modeling 'https://aka\.ms/efcore\-docs\-modeling') for more information and
|
||||
|
||||
Reference in New Issue
Block a user