To define relationships, constraints, or to configure non-entity types, you should override the _________ method in the DbContext.
- OnModelCreating
- OnEntityConfiguration
- ConfigureModel
- EntityOverrides
In ASP.NET Core Entity Framework, you should override the OnModelCreating method in the DbContext class. This method allows you to configure the database model, define relationships, and apply various constraints using Fluent API or data annotations.
Loading...
Related Quiz
- For ensuring that the test runs in isolation, real services or components might be replaced with _________ during unit testing.
- You're given the task to create a form in a Razor view that posts data to an MVC action named "Create" in the "Products" controller. Which built-in Tag Helper can help you generate the form's action attribute correctly?
- What purpose do Razor Tag Helpers serve in ASP.NET Core?
- Which of the following is NOT a default template option when creating a new ASP.NET Core project?
- What command would you typically use to create a new ASP.NET Core web application using the .NET Core CLI?