Table of Contents

Class DbContextPool<TContext>

Namespace
Microsoft.EntityFrameworkCore.Internal
Assembly
Microsoft.EntityFrameworkCore.dll

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

public class DbContextPool<TContext> : IDbContextPool<TContext>, IDbContextPool, IDisposable, IAsyncDisposable where TContext : DbContext

Type Parameters

TContext
Inheritance
DbContextPool<TContext>
Implements
IDbContextPool<TContext>
Inherited Members

Constructors

DbContextPool(DbContextOptions<TContext>, IServiceProvider?)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

public DbContextPool(DbContextOptions<TContext> options, IServiceProvider? serviceProvider = null)

Parameters

options DbContextOptions<TContext>
serviceProvider IServiceProvider

Fields

DefaultPoolSize

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

public const int DefaultPoolSize = 1024

Field Value

int

Methods

Dispose()

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

public virtual void Dispose()

DisposeAsync()

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

public virtual ValueTask DisposeAsync()

Returns

ValueTask

Rent()

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

public virtual IDbContextPoolable Rent()

Returns

IDbContextPoolable

Return(IDbContextPoolable)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

public virtual void Return(IDbContextPoolable context)

Parameters

context IDbContextPoolable

ReturnAsync(IDbContextPoolable, CancellationToken)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

public virtual ValueTask ReturnAsync(IDbContextPoolable context, CancellationToken cancellationToken = default)

Parameters

context IDbContextPoolable
cancellationToken CancellationToken

Returns

ValueTask