Share via


ProviderCodeGenerator Class

Definition

Generates provider-specific code fragments.

public abstract class ProviderCodeGenerator : Microsoft.EntityFrameworkCore.Scaffolding.IProviderConfigurationCodeGenerator
type ProviderCodeGenerator = class
    interface IProviderConfigurationCodeGenerator
Public MustInherit Class ProviderCodeGenerator
Implements IProviderConfigurationCodeGenerator
Inheritance
ProviderCodeGenerator
Implements

Remarks

The service lifetime is Singleton. This means a single instance is used by many DbContext instances. The implementation must be thread-safe. This service cannot depend on services registered as Scoped.

See Reverse engineering (scaffolding) an existing database, and EF Core design-time services for more information and examples.

Constructors

ProviderCodeGenerator(ProviderCodeGeneratorDependencies)

Initializes a new instance of the ProviderCodeGenerator class.

Properties

Dependencies

Relational provider-specific dependencies for this service.

Methods

GenerateContextOptions()

Generates a method chain to configure additional context options.

GenerateProviderOptions()

Generates a method chain used to configure provider-specific options.

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)
Obsolete.

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

Applies to