Which method in the DbContext is primarily used for configuring relationships using Fluent API?

  • DbSet
  • OnConfiguring
  • OnModelCreating
  • SaveChanges
In Entity Framework, the method OnModelCreating in the DbContext class is primarily used for configuring relationships using Fluent API. This method is called by the framework when the model for a derived context has been initialized, allowing developers to define entity configurations, including relationships, using a fluent syntax for more complex mappings.
Add your answer
Loading...

Leave a comment

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