Skip to content
Docs Try Aspire
Docs Try

EFMigrationResource

Class net8.0
📦 Aspire.Hosting.EntityFrameworkCore v13.3.0-preview.1.26254.5
Represents an EF Core migration resource associated with a project.
namespace Aspire.Hosting.EntityFrameworkCore;
public class EFMigrationResource
: Aspire.Hosting.ApplicationModel.ContainerResource
{
// ...
}
ContainerResource
The resource inherits from ApplicationModel.ContainerResource so it can be published as a container image that runs the migration bundle at deploy time when EFMigrationResourceBuilderExtensions.PublishAsMigrationBundle is called with publishContainer: true.
View all constructors
BundleBaseImageget; set
string?
Gets or sets the base container image for the migration bundle container.
BundleSelfContainedget; set
bool
Gets or sets whether the migration bundle should be self-contained.
BundleTargetRuntimeget; set
string?
Gets or sets the target runtime identifier for the migration bundle (e.g., "linux-x64", "win-x64").
DbContextTypeNameget
string?
Gets the fully qualified name of the DbContext type to use for migrations, or null to auto-detect.
MigrationNamespaceget; set
string?
Gets or sets the namespace for new migrations. Used by the Add Migration command.
MigrationOutputDirectoryget; set
string?
Gets or sets the output directory for new migrations. Used by the Add Migration command.
MigrationsProjectPathget; set
string?
Gets or sets the path to the project containing the migrations, when it's not the same as the startup project.
ProjectResourceget
ProjectResource
Gets the parent project resource that contains the DbContext.
PublishAsMigrationBundleget; set
bool
Gets or sets whether a migration bundle should be generated during publishing.
PublishAsMigrationScriptget; set
bool
Gets or sets whether a migration script should be generated during publishing.
PublishBundleContainerget; set
bool
Gets or sets whether the migration bundle should be published as a container image that applies the migrations to the database at deploy time.
ScriptIdempotentget; set
bool
Gets or sets whether the migration script should be idempotent (include IF NOT EXISTS checks).
ScriptNoTransactionsget; set
bool
Gets or sets whether to omit transaction statements from the migration script.
View all properties