Watch Aspire live streamsDocsTry Aspire

EFMigrationResource Constructors

ClassConstructors2 members
Represents an EF Core migration resource associated with a project.
Constructor(string, ProjectResource, string?)Section titled Constructor(string, ProjectResource, string?)
Initializes a new instance of the EFMigrationResource class.
public class EFMigrationResource
{
public EFMigrationResource(
string name,
ProjectResource projectResource,
string? dbContextTypeName)
{
// ...
}
}
namestringThe name of the resource.
projectResourceProjectResourceThe startup project resource that contains the DbContext.
dbContextTypeNamestring?The fully qualified name of the DbContext type, or null to auto-detect.
Constructor(string, IDotnetProgramResource, string?)Section titled Constructor(string, IDotnetProgramResource, string?)
Initializes a new instance of the EFMigrationResource class for a .NET program resource.
public class EFMigrationResource
{
public EFMigrationResource(
string name,
IDotnetProgramResource startupProjectResource,
string? dbContextTypeName)
{
// ...
}
}
namestringThe name of the resource.
startupProjectResourceIDotnetProgramResourceThe startup .NET program resource that contains the DbContext configuration.
dbContextTypeNamestring?The fully qualified name of the DbContext type, or null to auto-detect.
ArgumentNullExceptionstartupProjectResource is null.
This constructor captures resource data only. Use AddEFMigrations on a startup project builder to register the resource and configure its tools, commands, relationships, and publishing pipeline.