


From a performance standpoint AddDbContextPool() method is better over AddDbContext() method.DbContext pooling is conceptually similar to how connection pooling works in ADO.NET.With DbContext pooling, an instance from the DbContext pool is provided if available, rather than creating a new instance.The difference is, AddDbContextPool() method provides DbContext pooling.We can use either AddDbContext() or AddDbContextPool() method to register our application specific DbContext class with the ASP.NET Core dependency injection system.We usually specify this configuration in ConfigureServices() method in Startup.cs file.ĭifference between AddDbContext() and AddDbContextPool() methods.We want to configure and use Microsoft SQL Server with entity framework core.Options.UseSqlServer(Configuration.GetConnectionString( "EmployeeDBConnection"))) Public void ConfigureServices( IServiceCollection services) Public Startup( IConfiguration configuration)
