DbContextOptions.FindExtension<TExtension> Method

Definition

Gets the extension of the specified type. Returns null if no extension of the specified type is configured.

C#
public virtual TExtension FindExtension<TExtension> () where TExtension : class, Microsoft.EntityFrameworkCore.Infrastructure.IDbContextOptionsExtension;
C#
public virtual TExtension? FindExtension<TExtension> () where TExtension : class, Microsoft.EntityFrameworkCore.Infrastructure.IDbContextOptionsExtension;

Type Parameters

TExtension

The type of the extension to get.

Returns

TExtension

The extension, or null if none was found.

Implements

Applies to

Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0