ProviderCodeGenerator.GenerateUseProvider 方法

定义

重载

GenerateUseProvider(String)
已过时.

生成一个代码片段,例如 .UseSqlServer("Database=Foo") ,可在生成的 DbContext 的 方法中使用 OnConfiguring(DbContextOptionsBuilder)

GenerateUseProvider(String, MethodCallCodeFragment)

生成一个代码片段,例如 .UseSqlServer("Database=Foo") ,可在生成的 DbContext 的 方法中使用 OnConfiguring(DbContextOptionsBuilder)

GenerateUseProvider(String)

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

注意

Use the overload that takes provider options instead.

生成一个代码片段,例如 .UseSqlServer("Database=Foo") ,可在生成的 DbContext 的 方法中使用 OnConfiguring(DbContextOptionsBuilder)

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

参数

connectionString
String

要包含在代码片段中的连接字符串。

返回

代码片段。

实现

属性

适用于

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

生成一个代码片段,例如 .UseSqlServer("Database=Foo") ,可在生成的 DbContext 的 方法中使用 OnConfiguring(DbContextOptionsBuilder)

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

参数

connectionString
String

要包含在代码片段中的连接字符串。

providerOptions
MethodCallCodeFragment

用于配置提供程序选项的方法链。

返回

代码片段。

实现

适用于