Share via


ProviderCodeGenerator.GenerateUseProvider Method

Definition

Overloads

GenerateUseProvider(String)
Obsolete.

Generates a code fragment like .UseSqlServer("Database=Foo") which can be used in the OnConfiguring(DbContextOptionsBuilder) method of the generated DbContext.

GenerateUseProvider(String, MethodCallCodeFragment)

Generates a code fragment like .UseSqlServer("Database=Foo") which can be used in the OnConfiguring(DbContextOptionsBuilder) method of the generated DbContext.

GenerateUseProvider(String)

Source:
ProviderCodeGenerator.cs
Source:
ProviderCodeGenerator.cs
Source:
ProviderCodeGenerator.cs
Source:
ProviderCodeGenerator.cs
Source:
ProviderCodeGenerator.cs

Caution

Use the overload that takes provider options instead.

Generates a code fragment like .UseSqlServer("Database=Foo") which can be used in the OnConfiguring(DbContextOptionsBuilder) method of the generated DbContext.

public abstract Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment GenerateUseProvider (string connectionString);
[System.Obsolete("Use the overload that takes provider options instead.")]
public virtual Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment GenerateUseProvider (string connectionString);
public virtual Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment GenerateUseProvider (string connectionString);
abstract member GenerateUseProvider : string -> Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment
[<System.Obsolete("Use the overload that takes provider options instead.")>]
abstract member GenerateUseProvider : string -> Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment
override this.GenerateUseProvider : string -> Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment
abstract member GenerateUseProvider : string -> Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment
override this.GenerateUseProvider : string -> Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment
Public MustOverride Function GenerateUseProvider (connectionString As String) As MethodCallCodeFragment
Public Overridable Function GenerateUseProvider (connectionString As String) As MethodCallCodeFragment

Parameters

connectionString
String

The connection string to include in the code fragment.

Returns

The code fragment.

Implements

Attributes

Applies to

GenerateUseProvider(String, MethodCallCodeFragment)

Source:
ProviderCodeGenerator.cs
Source:
ProviderCodeGenerator.cs
Source:
ProviderCodeGenerator.cs
Source:
ProviderCodeGenerator.cs
Source:
ProviderCodeGenerator.cs
Source:
ProviderCodeGenerator.cs
Source:
ProviderCodeGenerator.cs
Source:
ProviderCodeGenerator.cs

Generates a code fragment like .UseSqlServer("Database=Foo") which can be used in the OnConfiguring(DbContextOptionsBuilder) method of the generated DbContext.

public virtual Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment GenerateUseProvider (string connectionString, Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment providerOptions);
public abstract Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment GenerateUseProvider (string connectionString, Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment providerOptions);
public abstract Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment GenerateUseProvider (string connectionString, Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment? providerOptions);
abstract member GenerateUseProvider : string * Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment -> Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment
override this.GenerateUseProvider : string * Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment -> Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment
abstract member GenerateUseProvider : string * Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment -> Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment
Public Overridable Function GenerateUseProvider (connectionString As String, providerOptions As MethodCallCodeFragment) As MethodCallCodeFragment
Public MustOverride Function GenerateUseProvider (connectionString As String, providerOptions As MethodCallCodeFragment) As MethodCallCodeFragment

Parameters

connectionString
String

The connection string to include in the code fragment.

providerOptions
MethodCallCodeFragment

The method chain used to configure provider options.

Returns

The code fragment.

Implements

Applies to