SqlServerDbContextOptionsExtensions.UseAzureSynapse Method

Definition

Overloads

UseAzureSynapse(DbContextOptionsBuilder, DbConnection, Boolean, Action<AzureSynapseDbContextOptionsBuilder>)

Configures the context to connect to a Azure Synapse database.

UseAzureSynapse(DbContextOptionsBuilder, String, Action<AzureSynapseDbContextOptionsBuilder>)

Configures the context to connect to a Azure Synapse database.

UseAzureSynapse(DbContextOptionsBuilder, Action<AzureSynapseDbContextOptionsBuilder>)

Configures the context to connect to a Azure Synapse database, but without initially setting any DbConnection or connection string.

UseAzureSynapse(DbContextOptionsBuilder, DbConnection, Action<AzureSynapseDbContextOptionsBuilder>)

Configures the context to connect to a Azure Synapse database.

UseAzureSynapse<TContext>(DbContextOptionsBuilder<TContext>, Action<AzureSynapseDbContextOptionsBuilder>)

Configures the context to connect to a Azure Synapse database, but without initially setting any DbConnection or connection string.

UseAzureSynapse<TContext>(DbContextOptionsBuilder<TContext>, DbConnection, Action<AzureSynapseDbContextOptionsBuilder>)

Configures the context to connect to a Azure Synapse database.

UseAzureSynapse<TContext>(DbContextOptionsBuilder<TContext>, String, Action<AzureSynapseDbContextOptionsBuilder>)

Configures the context to connect to a Azure Synapse database.

UseAzureSynapse<TContext>(DbContextOptionsBuilder<TContext>, DbConnection, Boolean, Action<AzureSynapseDbContextOptionsBuilder>)

Configures the context to connect to a Azure Synapse database.

UseAzureSynapse(DbContextOptionsBuilder, DbConnection, Boolean, Action<AzureSynapseDbContextOptionsBuilder>)

Source:
SqlServerDbContextOptionsBuilderExtensions.cs

Configures the context to connect to a Azure Synapse database.

C#
public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder UseAzureSynapse (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder optionsBuilder, System.Data.Common.DbConnection connection, bool contextOwnsConnection, Action<Microsoft.EntityFrameworkCore.Infrastructure.AzureSynapseDbContextOptionsBuilder>? azureSynapseOptionsAction = default);

Parameters

optionsBuilder
DbContextOptionsBuilder

The builder being used to configure the context.

connection
DbConnection

An existing DbConnection to be used to connect to the database. If the connection is in the open state then EF will not open or close the connection. If the connection is in the closed state then EF will open and close the connection as needed.

contextOwnsConnection
Boolean

If true, then EF will take ownership of the connection and will dispose it in the same way it would dispose a connection created by EF. If false, then the caller still owns the connection and is responsible for its disposal.

azureSynapseOptionsAction
Action<AzureSynapseDbContextOptionsBuilder>

An optional action to allow additional Azure Synapse specific configuration.

Returns

The options builder so that further configuration can be chained.

Remarks

See Using DbContextOptions, and Accessing SQL Server, Azure SQL, Azure Synapse databases with EF Core for more information and examples.

Applies to

Entity Framework Core 9.0
Proizvod Verzije
Entity Framework Core 9.0

UseAzureSynapse(DbContextOptionsBuilder, String, Action<AzureSynapseDbContextOptionsBuilder>)

Source:
SqlServerDbContextOptionsBuilderExtensions.cs

Configures the context to connect to a Azure Synapse database.

C#
public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder UseAzureSynapse (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder optionsBuilder, string? connectionString, Action<Microsoft.EntityFrameworkCore.Infrastructure.AzureSynapseDbContextOptionsBuilder>? azureSynapseOptionsAction = default);

Parameters

optionsBuilder
DbContextOptionsBuilder

The builder being used to configure the context.

connectionString
String

The connection string of the database to connect to.

azureSynapseOptionsAction
Action<AzureSynapseDbContextOptionsBuilder>

An optional action to allow additional Azure Synapse specific configuration.

Returns

The options builder so that further configuration can be chained.

Remarks

See Using DbContextOptions, and Accessing SQL Server, Azure SQL, Azure Synapse databases with EF Core for more information and examples.

Applies to

Entity Framework Core 9.0
Proizvod Verzije
Entity Framework Core 9.0

UseAzureSynapse(DbContextOptionsBuilder, Action<AzureSynapseDbContextOptionsBuilder>)

Source:
SqlServerDbContextOptionsBuilderExtensions.cs

Configures the context to connect to a Azure Synapse database, but without initially setting any DbConnection or connection string.

C#
public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder UseAzureSynapse (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder optionsBuilder, Action<Microsoft.EntityFrameworkCore.Infrastructure.AzureSynapseDbContextOptionsBuilder>? azureSynapseOptionsAction = default);

Parameters

optionsBuilder
DbContextOptionsBuilder

The builder being used to configure the context.

azureSynapseOptionsAction
Action<AzureSynapseDbContextOptionsBuilder>

An optional action to allow additional Azure Synapse specific configuration.

Returns

The options builder so that further configuration can be chained.

Remarks

The connection or connection string must be set before the DbContext is used to connect to a database. Set a connection using SetDbConnection(DatabaseFacade, DbConnection, Boolean). Set a connection string using SetConnectionString(DatabaseFacade, String).

See Using DbContextOptions, and Accessing SQL Server, Azure SQL, Azure Synapse databases with EF Core for more information and examples.

Applies to

Entity Framework Core 9.0
Proizvod Verzije
Entity Framework Core 9.0

UseAzureSynapse(DbContextOptionsBuilder, DbConnection, Action<AzureSynapseDbContextOptionsBuilder>)

Source:
SqlServerDbContextOptionsBuilderExtensions.cs

Configures the context to connect to a Azure Synapse database.

C#
public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder UseAzureSynapse (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder optionsBuilder, System.Data.Common.DbConnection connection, Action<Microsoft.EntityFrameworkCore.Infrastructure.AzureSynapseDbContextOptionsBuilder>? azureSynapseOptionsAction = default);

Parameters

optionsBuilder
DbContextOptionsBuilder

The builder being used to configure the context.

connection
DbConnection

An existing DbConnection to be used to connect to the database. If the connection is in the open state then EF will not open or close the connection. If the connection is in the closed state then EF will open and close the connection as needed. The caller owns the connection and is responsible for its disposal.

azureSynapseOptionsAction
Action<AzureSynapseDbContextOptionsBuilder>

An optional action to allow additional Azure Synapse specific configuration.

Returns

The options builder so that further configuration can be chained.

Remarks

See Using DbContextOptions, and Accessing SQL Server, Azure SQL, Azure Synapse databases with EF Core for more information and examples.

Applies to

Entity Framework Core 9.0
Proizvod Verzije
Entity Framework Core 9.0

UseAzureSynapse<TContext>(DbContextOptionsBuilder<TContext>, Action<AzureSynapseDbContextOptionsBuilder>)

Source:
SqlServerDbContextOptionsBuilderExtensions.cs

Configures the context to connect to a Azure Synapse database, but without initially setting any DbConnection or connection string.

C#
public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> UseAzureSynapse<TContext> (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> optionsBuilder, Action<Microsoft.EntityFrameworkCore.Infrastructure.AzureSynapseDbContextOptionsBuilder>? azureSynapseOptionsAction = default) where TContext : Microsoft.EntityFrameworkCore.DbContext;

Type Parameters

TContext

Parameters

optionsBuilder
DbContextOptionsBuilder<TContext>

The builder being used to configure the context.

azureSynapseOptionsAction
Action<AzureSynapseDbContextOptionsBuilder>

An optional action to allow additional Azure Synapse specific configuration.

Returns

The options builder so that further configuration can be chained.

Remarks

The connection or connection string must be set before the DbContext is used to connect to a database. Set a connection using SetDbConnection(DatabaseFacade, DbConnection, Boolean). Set a connection string using SetConnectionString(DatabaseFacade, String).

See Using DbContextOptions, and Accessing SQL Server, Azure SQL, Azure Synapse databases with EF Core for more information and examples.

Applies to

Entity Framework Core 9.0
Proizvod Verzije
Entity Framework Core 9.0

UseAzureSynapse<TContext>(DbContextOptionsBuilder<TContext>, DbConnection, Action<AzureSynapseDbContextOptionsBuilder>)

Source:
SqlServerDbContextOptionsBuilderExtensions.cs

Configures the context to connect to a Azure Synapse database.

C#
public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> UseAzureSynapse<TContext> (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> optionsBuilder, System.Data.Common.DbConnection connection, Action<Microsoft.EntityFrameworkCore.Infrastructure.AzureSynapseDbContextOptionsBuilder>? azureSynapseOptionsAction = default) where TContext : Microsoft.EntityFrameworkCore.DbContext;

Type Parameters

TContext

The type of context to be configured.

Parameters

optionsBuilder
DbContextOptionsBuilder<TContext>

The builder being used to configure the context.

connection
DbConnection

An existing DbConnection to be used to connect to the database. If the connection is in the open state then EF will not open or close the connection. If the connection is in the closed state then EF will open and close the connection as needed. The caller owns the connection and is responsible for its disposal.

azureSynapseOptionsAction
Action<AzureSynapseDbContextOptionsBuilder>

An optional action to allow additional Azure Synapse specific configuration.

Returns

The options builder so that further configuration can be chained.

Remarks

See Using DbContextOptions, and Accessing SQL Server, Azure SQL, Azure Synapse databases with EF Core for more information and examples.

Applies to

Entity Framework Core 9.0
Proizvod Verzije
Entity Framework Core 9.0

UseAzureSynapse<TContext>(DbContextOptionsBuilder<TContext>, String, Action<AzureSynapseDbContextOptionsBuilder>)

Source:
SqlServerDbContextOptionsBuilderExtensions.cs

Configures the context to connect to a Azure Synapse database.

C#
public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> UseAzureSynapse<TContext> (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> optionsBuilder, string? connectionString, Action<Microsoft.EntityFrameworkCore.Infrastructure.AzureSynapseDbContextOptionsBuilder>? azureSynapseOptionsAction = default) where TContext : Microsoft.EntityFrameworkCore.DbContext;

Type Parameters

TContext

The type of context to be configured.

Parameters

optionsBuilder
DbContextOptionsBuilder<TContext>

The builder being used to configure the context.

connectionString
String

The connection string of the database to connect to.

azureSynapseOptionsAction
Action<AzureSynapseDbContextOptionsBuilder>

An optional action to allow additional Azure Synapse specific configuration.

Returns

The options builder so that further configuration can be chained.

Remarks

See Using DbContextOptions, and Accessing SQL Server, Azure SQL, Azure Synapse databases with EF Core for more information and examples.

Applies to

Entity Framework Core 9.0
Proizvod Verzije
Entity Framework Core 9.0

UseAzureSynapse<TContext>(DbContextOptionsBuilder<TContext>, DbConnection, Boolean, Action<AzureSynapseDbContextOptionsBuilder>)

Source:
SqlServerDbContextOptionsBuilderExtensions.cs

Configures the context to connect to a Azure Synapse database.

C#
public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> UseAzureSynapse<TContext> (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> optionsBuilder, System.Data.Common.DbConnection connection, bool contextOwnsConnection, Action<Microsoft.EntityFrameworkCore.Infrastructure.AzureSynapseDbContextOptionsBuilder>? azureSynapseOptionsAction = default) where TContext : Microsoft.EntityFrameworkCore.DbContext;

Type Parameters

TContext

The type of context to be configured.

Parameters

optionsBuilder
DbContextOptionsBuilder<TContext>

The builder being used to configure the context.

connection
DbConnection

An existing DbConnection to be used to connect to the database. If the connection is in the open state then EF will not open or close the connection. If the connection is in the closed state then EF will open and close the connection as needed.

contextOwnsConnection
Boolean

If true, then EF will take ownership of the connection and will dispose it in the same way it would dispose a connection created by EF. If false, then the caller still owns the connection and is responsible for its disposal.

azureSynapseOptionsAction
Action<AzureSynapseDbContextOptionsBuilder>

An optional action to allow additional Azure Synapse specific configuration.

Returns

The options builder so that further configuration can be chained.

Remarks

See Using DbContextOptions, and Accessing SQL Server, Azure SQL, Azure Synapse databases with EF Core for more information and examples.

Applies to

Entity Framework Core 9.0
Proizvod Verzije
Entity Framework Core 9.0