Watch Aspire live streamsDocsTry Aspire
Watch Aspire live streamsDocsTry

EFMigrationResource

Handle
📦 Aspire.Hosting.EntityFrameworkCore v13.6.0-preview.1.26478.8
interface EFMigrationResource
extends IComputeResource,
IResource,
IResourceWithArgs,
IResourceWithEndpoints,
IResourceWithEnvironment,
IResourceWithProbes,
IResourceWithWaitSupport {
bundleBaseImage: string;
bundleSelfContained: boolean;
bundleTargetRuntime: string;
readonly dbContextTypeName: string;
migrationNamespace: string;
migrationOutputDirectory: string;
migrationsProjectPath: string;
readonly projectResource: ProjectResource;
publishBundleContainer: boolean;
scriptIdempotent: boolean;
scriptNoTransactions: boolean;
readonly startupProjectResource: IDotnetProgramResource;
publishAsMigrationBundle(
targetRuntime?: string,
selfContained?: boolean,
publishContainer?: boolean,
baseImage?: string): EFMigrationResource;
publishAsMigrationScript(
idempotent?: boolean,
noTransactions?: boolean): EFMigrationResource;
runDatabaseUpdateOnStart(): EFMigrationResource;
withMigrationNamespace(namespace: string): EFMigrationResource;
withMigrationOutputDirectory(outputDirectory: string): EFMigrationResource;
withMigrationsProject(migrationsProject?: string | IDotnetProgramResource): EFMigrationResource;
}

Properties

propertybundleBaseImagestringget · set
Gets or sets the base container image for the migration bundle container.
propertybundleSelfContainedbooleanget · set
Gets or sets whether the migration bundle should be self-contained.
propertybundleTargetRuntimestringget · set
Gets or sets the target runtime identifier for the migration bundle (e.g., "linux-x64", "win-x64").
propertydbContextTypeNamestringget
Gets the fully qualified name of the DbContext type to use for migrations, or null to auto-detect.
propertymigrationNamespacestringget · set
Gets or sets the namespace for new migrations. Used by the Add Migration command.
propertymigrationOutputDirectorystringget · set
Gets or sets the output directory for new migrations. Used by the Add Migration command.
propertymigrationsProjectPathstringget · set
Gets or sets the path to the project containing the migrations, when it's not the same as the startup project.
propertyprojectResourceProjectResourceget
Gets the parent project resource that contains the DbContext.
propertypublishBundleContainerbooleanget · set
Gets or sets whether the migration bundle should be published as a container image that applies the migrations to the database at deploy time.
propertyscriptIdempotentbooleanget · set
Gets or sets whether the migration script should be idempotent (include IF NOT EXISTS checks).
propertyscriptNoTransactionsbooleanget · set
Gets or sets whether to omit transaction statements from the migration script.
propertystartupProjectResourceIDotnetProgramResourceget
Gets the startup .NET program resource that contains the DbContext configuration.

Methods

Configures the EF migration resource to generate a migration bundle during publishing.
publishAsMigrationBundle(
targetRuntime?: string,
selfContained?: boolean,
publishContainer?: boolean,
baseImage?: string): EFMigrationResource
targetRuntimestringoptional
selfContainedbooleanoptional= False
publishContainerbooleanoptional= False
baseImagestringoptional
EFMigrationResource
Configures the EF migration resource to generate a migration script during publishing.
publishAsMigrationScript(
idempotent?: boolean,
noTransactions?: boolean): EFMigrationResource
idempotentbooleanoptional= True
noTransactionsbooleanoptional= False
EFMigrationResource
Configures the EF migration resource to run database update when the AppHost starts.
runDatabaseUpdateOnStart(): EFMigrationResource
EFMigrationResource
Configures the namespace for new migrations created with the Add Migration command.
withMigrationNamespace(namespace: string): EFMigrationResource
namespacestring
EFMigrationResource
Configures the output directory for new migrations created with the Add Migration command.
withMigrationOutputDirectory(outputDirectory: string): EFMigrationResource
outputDirectorystring
EFMigrationResource
Configures a separate project containing migrations for polyglot AppHosts.
withMigrationsProject(migrationsProject?: string | IDotnetProgramResource): EFMigrationResource
migrationsProjectstring | IDotnetProgramResourceoptional
EFMigrationResource