Skip to content

DatabaseTypeExtensions.GetDatabaseType

Mike King edited this page Sep 30, 2025 · 2 revisions

DatabaseTypeExtensions.GetDatabaseType Method

Overloads
GetDatabaseType(this DbContextOptionsBuilder) Gets the type of database in use from a Microsoft.EntityFrameworkCore.DbContextOptionsBuilder object.
GetDatabaseType(this DatabaseFacade) Gets the type of database in use from a Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade object.
GetDatabaseType(this MigrationBuilder) Gets the type of database in use from a Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder object.

DatabaseTypeExtensions.GetDatabaseType(this DbContextOptionsBuilder) Method

Gets the type of database in use from a Microsoft.EntityFrameworkCore.DbContextOptionsBuilder object.

public static string? GetDatabaseType(this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder optionsBuilder);

Parameters

optionsBuilder Microsoft.EntityFrameworkCore.DbContextOptionsBuilder

A builder used to create or modify options for this context.

Returns

System.String
System.String with the database type or null if none recognised.

DatabaseTypeExtensions.GetDatabaseType(this DatabaseFacade) Method

Gets the type of database in use from a Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade object.

public static string? GetDatabaseType(this Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade database);

Parameters

database Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade

The Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade for the context.

Returns

System.String
System.String with the database type or null if none recognised.

DatabaseTypeExtensions.GetDatabaseType(this MigrationBuilder) Method

Gets the type of database in use from a Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder object.

public static string? GetDatabaseType(this Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder builder);

Parameters

builder Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder

The migration builder.

Returns

System.String
System.String with the database type or null if none recognised.

Clone this wiki locally