Which method is often overridden within a DbContext class to configure models?

  • OnModelCreating
  • OnDatabaseUpdate
  • ConfigureModels
  • ModelBuilder
The OnModelCreating method is often overridden within a DbContext class to configure the database model. This method is where you define the relationships between entities, specify keys, and configure other aspects of your database schema using the ModelBuilder provided as a parameter. It allows you to customize how your entities map to database tables.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *