EFMigrationResource
Classnet10.0
Represents an EF Core migration resource associated with a project.
namespace Aspire.Hosting.EntityFrameworkCore;
public class EFMigrationResource : Aspire.Hosting.ApplicationModel.ContainerResource{ // ...}ContainerResource
17 members
Remarks
Section titled Remarks 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 . Constructors2
Section titled Constructors Initializes a new instance of the
EFMigrationResource class. Initializes a new instance of the
EFMigrationResource class for a .NET program resource. Properties15
Section titled PropertiesBundleBaseImage get; setstring? Gets or sets the base container image for the migration bundle container.
BundleTargetRuntime get; setstring? Gets or sets the target runtime identifier for the migration bundle (e.g., "linux-x64", "win-x64").
string? Gets the fully qualified name of the DbContext type to use for migrations, or null to auto-detect.
MigrationNamespace get; setstring? Gets or sets the namespace for new migrations. Used by the Add Migration command.
MigrationOutputDirectory get; setstring? Gets or sets the output directory for new migrations. Used by the Add Migration command.
MigrationsProjectPath get; setstring? Gets or sets the path to the project containing the migrations, when it's not the same as the startup project.
ProjectResource Gets the parent project resource that contains the DbContext.
bool Gets or sets whether a migration bundle should be generated during publishing.
bool Gets or sets whether a migration script should be generated during publishing.
PublishBundleContainer get; setbool Gets or sets whether the migration bundle should be published as a container image that applies the migrations to the database at deploy time.
ScriptIdempotent get; setbool Gets or sets whether the migration script should be idempotent (include IF NOT EXISTS checks).
ScriptNoTransactions get; setbool Gets or sets whether to omit transaction statements from the migration script.
IDotnetProgramResource Gets the startup .NET program resource that contains the DbContext configuration.