Class KEFCoreReadOnlyConvention
- Namespace
- MASES.EntityFrameworkCore.KNet.Metadata.Conventions
- Assembly
- MASES.EntityFrameworkCore.KNet.dll
A convention that resolves per-entity read-only configuration at model finalization time, storing the result as a model annotation on each IEntityType.
public class KEFCoreReadOnlyConvention : IModelFinalizingConvention, IConvention
- Inheritance
-
KEFCoreReadOnlyConvention
- Implements
- Inherited Members
Remarks
Reads KEFCoreReadOnlyAttribute from the entity CLR type. Entities marked read-only will throw InvalidOperationException on any SaveChanges() attempt, regardless of the context-level ReadOnlyMode setting.
Methods
ProcessModelFinalizing(IConventionModelBuilder, IConventionContext<IConventionModelBuilder>)
Called when a model is being finalized.
public void ProcessModelFinalizing(IConventionModelBuilder modelBuilder, IConventionContext<IConventionModelBuilder> context)
Parameters
modelBuilderIConventionModelBuilderThe builder for the model.
contextIConventionContext<IConventionModelBuilder>Additional information associated with convention execution.