ProviderCodeGenerator.GenerateUseProvider 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
GenerateUseProvider(String) |
已淘汰.
產生類似 的代碼 |
GenerateUseProvider(String, MethodCallCodeFragment) |
產生類似 的代碼 |
GenerateUseProvider(String)
警告
Use the overload that takes provider options instead.
產生類似 的代碼 .UseSqlServer("Database=Foo")
段,可用於 OnConfiguring(DbContextOptionsBuilder) 所產生 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
參數
- connectionString
- String
要包含在程式碼片段中的連接字串。
傳回
程式碼片段。
實作
- 屬性
適用於
GenerateUseProvider(String, MethodCallCodeFragment)
產生類似 的代碼 .UseSqlServer("Database=Foo")
段,可用於 OnConfiguring(DbContextOptionsBuilder) 所產生 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
參數
- connectionString
- String
要包含在程式碼片段中的連接字串。
- providerOptions
- MethodCallCodeFragment
用來設定提供者選項的方法鏈結。
傳回
程式碼片段。