ProviderCodeGenerator.GenerateUseProvider Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GenerateUseProvider(String) |
Obsolete.
Generates a code fragment like |
GenerateUseProvider(String, MethodCallCodeFragment) |
Generates a code fragment like |
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
Entity Framework