Class NpgsqlDatabaseFacadeExtensions
Npgsql specific extension methods for
Inheritance
object
NpgsqlDatabaseFacadeExtensions
Namespace: Microsoft.EntityFrameworkCore
Assembly: Npgsql.EntityFrameworkCore.PostgreSQL.dll
Syntax
public static class NpgsqlDatabaseFacadeExtensions
Methods
| Improve this Doc View SourceIsNpgsql(DatabaseFacade)
Returns true if the database provider currently in use is the Npgsql provider.
This method can only be used after the
Declaration
public static bool IsNpgsql(this DatabaseFacade database)
Parameters
Type | Name | Description |
---|---|---|
DatabaseFacade | database | The facade from |
Returns
Type | Description |
---|---|
bool | True if Npgsql is being used; false otherwise. |
SetDbDataSource(DatabaseFacade, DbDataSource)
Sets the underlying
Declaration
public static void SetDbDataSource(this DatabaseFacade databaseFacade, DbDataSource dataSource)
Parameters
Type | Name | Description |
---|---|---|
DatabaseFacade | databaseFacade | The |
DbDataSource | dataSource | The connection string. |
Remarks
It may not be possible to change the data source if existing connection, if any, is open.
See Connections and connection strings for more information and examples.