EFMigrationResource
Class net8.0
Represents an EF Core migration resource associated with a project.
namespace Aspire.Hosting.EntityFrameworkCore;
public class EFMigrationResource : Aspire.Hosting.ApplicationModel.ContainerResource{ // ...} ContainerResource
14 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 ConstructorsProperties13
Section titled PropertiesBundleBaseImageget; setstring? Gets or sets the base container image for the migration bundle container.
BundleSelfContainedget; setbool Gets or sets whether the migration bundle should be self-contained.
BundleTargetRuntimeget; setstring? Gets or sets the target runtime identifier for the migration bundle (e.g., "linux-x64", "win-x64").
DbContextTypeNamegetstring? 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.
ProjectResourcegetProjectResource Gets the parent project resource that contains the DbContext.
PublishAsMigrationBundleget; setbool Gets or sets whether a migration bundle should be generated during publishing.
PublishAsMigrationScriptget; setbool 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.