DbContextOptionsBuilder<TContext>.UseModel(IModel) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sets the model to be used for the context. If the model is set, then OnModelCreating(ModelBuilder) will not be run.
public virtual Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> UseModel (Microsoft.EntityFrameworkCore.Metadata.IModel model);
override this.UseModel : Microsoft.EntityFrameworkCore.Metadata.IModel -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<'Context (requires 'Context :> Microsoft.EntityFrameworkCore.DbContext)>
Public Overridable Function UseModel (model As IModel) As DbContextOptionsBuilder(Of TContext)
Parameters
- model
- IModel
The model to be used.
Returns
The same builder instance so that multiple calls can be chained.
Remarks
If setting an externally created model FinalizeModel() should be called first.
See Using DbContextOptions and Model Building for more information and examples.
Applies to
Entity Framework
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: Under hela 2024 kommer vi att fasa ut GitHub-problem som feedbackmekanism för innehåll och ersätta det med ett nytt feedbacksystem. Mer information finns i:Skicka och visa feedback för