Class RuntimeModelConvention
- Namespace
- Microsoft.EntityFrameworkCore.Metadata.Conventions
- Assembly
- Microsoft.EntityFrameworkCore.dll
A convention that creates an optimized copy of the mutable model. This convention is typically implemented by database providers to update provider annotations when creating a read-only model.
public class RuntimeModelConvention : IModelFinalizedConvention, IConvention
- Inheritance
-
RuntimeModelConvention
- Implements
- Inherited Members
Remarks
See Model building conventions for more information and examples.
Constructors
RuntimeModelConvention(ProviderConventionSetBuilderDependencies)
Creates a new instance of RuntimeModelConvention.
public RuntimeModelConvention(ProviderConventionSetBuilderDependencies dependencies)
Parameters
dependencies
ProviderConventionSetBuilderDependenciesParameter object containing dependencies for this convention.
Properties
Dependencies
Dependencies for this service.
protected virtual ProviderConventionSetBuilderDependencies Dependencies { get; }
Property Value
Methods
Create(IModel)
Creates an optimized model base on the supplied one.
protected virtual RuntimeModel Create(IModel model)
Parameters
model
IModelThe source model.
Returns
- RuntimeModel
An optimized model.
GetForeignKey(IForeignKey, RuntimeEntityType)
Gets the corresponding foreign key in the read-optimized model.
protected virtual RuntimeForeignKey GetForeignKey(IForeignKey foreignKey, RuntimeEntityType entityType)
Parameters
foreignKey
IForeignKeyThe original foreign key.
entityType
RuntimeEntityTypeThe declaring entity type.
Returns
- RuntimeForeignKey
The corresponding read-optimized foreign key.
GetIndex(IIndex, RuntimeEntityType)
Gets the corresponding index in the read-optimized model.
protected virtual RuntimeIndex GetIndex(IIndex index, RuntimeEntityType entityType)
Parameters
index
IIndexThe original index.
entityType
RuntimeEntityTypeThe declaring entity type.
Returns
- RuntimeIndex
The corresponding read-optimized index.
GetKey(IKey, RuntimeEntityType)
Gets the corresponding key in the read-optimized model.
protected virtual RuntimeKey GetKey(IKey key, RuntimeEntityType entityType)
Parameters
key
IKeyThe original key.
entityType
RuntimeEntityTypeThe declaring entity type.
Returns
- RuntimeKey
The corresponding read-optimized key.
ProcessComplexPropertyAnnotations(Dictionary<string, object?>, IComplexProperty, RuntimeComplexProperty, bool)
Updates the property annotations that will be set on the read-only object.
protected virtual void ProcessComplexPropertyAnnotations(Dictionary<string, object?> annotations, IComplexProperty property, RuntimeComplexProperty runtimeProperty, bool runtime)
Parameters
annotations
Dictionary<string, object>The annotations to be processed.
property
IComplexPropertyThe source property.
runtimeProperty
RuntimeComplexPropertyThe target property that will contain the annotations.
runtime
boolIndicates whether the given annotations are runtime annotations.
ProcessElementTypeAnnotations(Dictionary<string, object?>, IElementType, RuntimeElementType, bool)
Updates the element type annotations that will be set on the read-only object.
protected virtual void ProcessElementTypeAnnotations(Dictionary<string, object?> annotations, IElementType element, RuntimeElementType runtimeElement, bool runtime)
Parameters
annotations
Dictionary<string, object>The annotations to be processed.
element
IElementTypeThe source element type.
runtimeElement
RuntimeElementTypeThe target element type that will contain the annotations.
runtime
boolIndicates whether the given annotations are runtime annotations.
ProcessEntityTypeAnnotations(Dictionary<string, object?>, IEntityType, RuntimeEntityType, bool)
Updates the entity type annotations that will be set on the read-only object.
protected virtual void ProcessEntityTypeAnnotations(Dictionary<string, object?> annotations, IEntityType entityType, RuntimeEntityType runtimeEntityType, bool runtime)
Parameters
annotations
Dictionary<string, object>The annotations to be processed.
entityType
IEntityTypeThe source entity type.
runtimeEntityType
RuntimeEntityTypeThe target entity type that will contain the annotations.
runtime
boolIndicates whether the given annotations are runtime annotations.
ProcessForeignKeyAnnotations(Dictionary<string, object?>, IForeignKey, RuntimeForeignKey, bool)
Updates the foreign key annotations that will be set on the read-only object.
protected virtual void ProcessForeignKeyAnnotations(Dictionary<string, object?> annotations, IForeignKey foreignKey, RuntimeForeignKey runtimeForeignKey, bool runtime)
Parameters
annotations
Dictionary<string, object>The annotations to be processed.
foreignKey
IForeignKeyThe source foreign key.
runtimeForeignKey
RuntimeForeignKeyThe target foreign key that will contain the annotations.
runtime
boolIndicates whether the given annotations are runtime annotations.
ProcessIndexAnnotations(Dictionary<string, object?>, IIndex, RuntimeIndex, bool)
Updates the index annotations that will be set on the read-only object.
protected virtual void ProcessIndexAnnotations(Dictionary<string, object?> annotations, IIndex index, RuntimeIndex runtimeIndex, bool runtime)
Parameters
annotations
Dictionary<string, object>The annotations to be processed.
index
IIndexThe source index.
runtimeIndex
RuntimeIndexThe target index that will contain the annotations.
runtime
boolIndicates whether the given annotations are runtime annotations.
ProcessKeyAnnotations(Dictionary<string, object?>, IKey, RuntimeKey, bool)
Updates the key annotations that will be set on the read-only object.
protected virtual void ProcessKeyAnnotations(Dictionary<string, object?> annotations, IKey key, RuntimeKey runtimeKey, bool runtime)
Parameters
annotations
Dictionary<string, object>The annotations to be processed.
key
IKeyThe source key.
runtimeKey
RuntimeKeyThe target key that will contain the annotations.
runtime
boolIndicates whether the given annotations are runtime annotations.
ProcessModelAnnotations(Dictionary<string, object?>, IModel, RuntimeModel, bool)
Updates the model annotations that will be set on the read-only object.
protected virtual void ProcessModelAnnotations(Dictionary<string, object?> annotations, IModel model, RuntimeModel runtimeModel, bool runtime)
Parameters
annotations
Dictionary<string, object>The annotations to be processed.
model
IModelThe source model.
runtimeModel
RuntimeModelThe target model that will contain the annotations.
runtime
boolIndicates whether the given annotations are runtime annotations.
ProcessModelFinalized(IModel)
public virtual IModel ProcessModelFinalized(IModel model)
Parameters
model
IModel
Returns
ProcessNavigationAnnotations(Dictionary<string, object?>, INavigation, RuntimeNavigation, bool)
Updates the navigation annotations that will be set on the read-only object.
protected virtual void ProcessNavigationAnnotations(Dictionary<string, object?> annotations, INavigation navigation, RuntimeNavigation runtimeNavigation, bool runtime)
Parameters
annotations
Dictionary<string, object>The annotations to be processed.
navigation
INavigationThe source navigation.
runtimeNavigation
RuntimeNavigationThe target navigation that will contain the annotations.
runtime
boolIndicates whether the given annotations are runtime annotations.
ProcessPropertyAnnotations(Dictionary<string, object?>, IProperty, RuntimeProperty, bool)
Updates the property annotations that will be set on the read-only object.
protected virtual void ProcessPropertyAnnotations(Dictionary<string, object?> annotations, IProperty property, RuntimeProperty runtimeProperty, bool runtime)
Parameters
annotations
Dictionary<string, object>The annotations to be processed.
property
IPropertyThe source property.
runtimeProperty
RuntimePropertyThe target property that will contain the annotations.
runtime
boolIndicates whether the given annotations are runtime annotations.
ProcessServicePropertyAnnotations(Dictionary<string, object?>, IServiceProperty, RuntimeServiceProperty, bool)
Updates the service property annotations that will be set on the read-only object.
protected virtual void ProcessServicePropertyAnnotations(Dictionary<string, object?> annotations, IServiceProperty property, RuntimeServiceProperty runtimeProperty, bool runtime)
Parameters
annotations
Dictionary<string, object>The annotations to be processed.
property
IServicePropertyThe source service property.
runtimeProperty
RuntimeServicePropertyThe target service property that will contain the annotations.
runtime
boolIndicates whether the given annotations are runtime annotations.
ProcessSkipNavigationAnnotations(Dictionary<string, object?>, ISkipNavigation, RuntimeSkipNavigation, bool)
Updates the skip navigation annotations that will be set on the read-only object.
protected virtual void ProcessSkipNavigationAnnotations(Dictionary<string, object?> annotations, ISkipNavigation skipNavigation, RuntimeSkipNavigation runtimeSkipNavigation, bool runtime)
Parameters
annotations
Dictionary<string, object>The annotations to be processed.
skipNavigation
ISkipNavigationThe source skip navigation.
runtimeSkipNavigation
RuntimeSkipNavigationThe target skip navigation that will contain the annotations.
runtime
boolIndicates whether the given annotations are runtime annotations.
ProcessTriggerAnnotations(Dictionary<string, object?>, ITrigger, RuntimeTrigger, bool)
Updates the trigger annotations that will be set on the read-only object.
protected virtual void ProcessTriggerAnnotations(Dictionary<string, object?> annotations, ITrigger trigger, RuntimeTrigger runtimeTrigger, bool runtime)
Parameters
annotations
Dictionary<string, object>The annotations to be processed.
trigger
ITriggerThe source trigger.
runtimeTrigger
RuntimeTriggerThe target trigger that will contain the annotations.
runtime
boolIndicates whether the given annotations are runtime annotations.
ProcessTypeMappingConfigurationAnnotations(Dictionary<string, object?>, ITypeMappingConfiguration, RuntimeTypeMappingConfiguration, bool)
Updates the property annotations that will be set on the read-only object.
protected virtual void ProcessTypeMappingConfigurationAnnotations(Dictionary<string, object?> annotations, ITypeMappingConfiguration typeConfiguration, RuntimeTypeMappingConfiguration runtimeTypeConfiguration, bool runtime)
Parameters
annotations
Dictionary<string, object>The annotations to be processed.
typeConfiguration
ITypeMappingConfigurationThe source property.
runtimeTypeConfiguration
RuntimeTypeMappingConfigurationThe target property that will contain the annotations.
runtime
boolIndicates whether the given annotations are runtime annotations.