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
15 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. Constructors1
Section titled Constructors Initializes a new instance of the
EFMigrationResource class. Properties14
Section titled PropertiesBundleBaseImageget; setstring? Gets or sets the base container image for the migration bundle container.
BundleTargetRuntimeget; 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.
MigrationNamespaceget; setstring? Gets or sets the namespace for new migrations. Used by the Add Migration command.
MigrationOutputDirectoryget; setstring? Gets or sets the output directory for new migrations. Used by the Add Migration command.
MigrationsProjectPathget; 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.
PublishBundleContainerget; 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.
ScriptIdempotentget; setbool Gets or sets whether the migration script should be idempotent (include IF NOT EXISTS checks).
ScriptNoTransactionsget; 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.