DbContextOptionsBuilder.UseModel(IModel) Method
In this article
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 UseModel(Microsoft.EntityFrameworkCore.Metadata.IModel model);
abstract member UseModel : Microsoft.EntityFrameworkCore.Metadata.IModel -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder
override this.UseModel : Microsoft.EntityFrameworkCore.Metadata.IModel -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder
Public Overridable Function UseModel (model As IModel) As DbContextOptionsBuilder
- model
- IModel
The model to be used.
The same builder instance so that multiple calls can be chained.
If setting an externally created model FinalizeModel() should be called first.
See Using DbContextOptions and Model Building for more information and examples.
Applies to
Product | Versions |
---|---|
Entity Framework Core | 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0 |
Entity Framework feedback
Entity Framework is an open source project. Select a link to provide feedback: