Share via


IProviderConfigurationCodeGenerator.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:
IProviderConfigurationCodeGenerator.cs
Source:
IProviderConfigurationCodeGenerator.cs
Source:
IProviderConfigurationCodeGenerator.cs
Source:
IProviderConfigurationCodeGenerator.cs
Source:
IProviderConfigurationCodeGenerator.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 Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment GenerateUseProvider (string connectionString);
[System.Obsolete("Use the overload that takes provider options instead.")]
public 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
abstract member GenerateUseProvider : string -> Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment
override this.GenerateUseProvider : string -> Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment
Public 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.

Attributes

Applies to

GenerateUseProvider(String, MethodCallCodeFragment)

Source:
IProviderConfigurationCodeGenerator.cs
Source:
IProviderConfigurationCodeGenerator.cs
Source:
IProviderConfigurationCodeGenerator.cs
Source:
IProviderConfigurationCodeGenerator.cs
Source:
IProviderConfigurationCodeGenerator.cs

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

public Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment GenerateUseProvider (string connectionString, Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment providerOptions);
public Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment GenerateUseProvider (string connectionString, Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment? providerOptions);
abstract member GenerateUseProvider : string * Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment -> Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment
Public 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.

Applies to