EFMigrationResource
Represents an EF Core migration resource associated with a project.
type EFMigrationResource interface { IComputeResource Resource ResourceWithArgs ResourceWithEndpoints ResourceWithEnvironment ResourceWithWaitSupport}Properties
BundleBaseImage *stringget · setBundleBaseImage() (*string, error)SetBundleBaseImage(value *string) EFMigrationResourceBundleSelfContained boolget · setBundleSelfContained() (bool, error)SetBundleSelfContained(value bool) EFMigrationResourceBundleTargetRuntime *stringget · setBundleTargetRuntime() (*string, error)SetBundleTargetRuntime(value *string) EFMigrationResourceDbContextTypeName *stringgetDbContextTypeName() (*string, error)MigrationNamespace *stringget · setMigrationNamespace() (*string, error)SetMigrationNamespace(value *string) EFMigrationResourceMigrationOutputDirectory *stringget · setMigrationOutputDirectory() (*string, error)SetMigrationOutputDirectory(value *string) EFMigrationResourceMigrationsProjectPath *stringget · setMigrationsProjectPath() (*string, error)SetMigrationsProjectPath(value *string) EFMigrationResourceProjectResource ProjectResource getProjectResource() ProjectResourcePublishBundleContainer boolget · setPublishBundleContainer() (bool, error)SetPublishBundleContainer(value bool) EFMigrationResourceResourceTypeDisplayName stringgetResourceTypeDisplayName() (string, error)ScriptIdempotent boolget · setScriptIdempotent() (bool, error)SetScriptIdempotent(value bool) EFMigrationResourceScriptNoTransactions boolget · setScriptNoTransactions() (bool, error)SetScriptNoTransactions(value bool) EFMigrationResourceStartupProjectResource DotnetProgramResource getStartupProjectResource() DotnetProgramResourceMethods
PublishAsMigrationBundle(options ...*PublishAsMigrationBundleOptions) EFMigrationResourceParameters
options...*PublishAsMigrationBundleOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*PublishAsMigrationBundleOptions argument.
TargetRuntime *stringThe target runtime identifier for the bundle (e.g., linux-x64 , win-x64 ). If null and publishContainer is true, defaults to linux-x64 to match the default Linux base container image used for the generated Dockerfile. If null and publishContainer is false, the bundle targets the runtime hosting aspire publish.SelfContained *boolIf true, creates a self-contained bundle that includes the .NET runtime.PublishContainer *boolIf true, the bundle is published as a container image that applies migrations at deploy time. The resource becomes a compute resource; each target environment deploys it the same way it deploys any other container (supplying connection strings from referenced IResourceWithConnectionString dependencies via the standard WithReference mechanism).BaseImage *stringOverrides the base container image for the generated Dockerfile. When null (the default), the image is derived from the project's target framework — for example, mcr.microsoft.com/dotnet/runtime:10.0 for a net10.0 framework-dependent bundle. Set this when the default is not suitable, e.g. for preview SDKs or custom base images. Only meaningful when publishContainer is true.Returns
EFMigrationResource The resource builder for chaining.
Returns a handle; failures surface later via Err().
PublishAsMigrationScript(options ...*PublishAsMigrationScriptOptions) EFMigrationResourceParameters
options...*PublishAsMigrationScriptOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*PublishAsMigrationScriptOptions argument.
Idempotent*boolIf true (the default), generates an idempotent script with IF NOT EXISTS checks so it can be safely re-run against a database that has already had some or all of the migrations applied.NoTransactions *boolIf true, omits transaction statements from the script.Returns
EFMigrationResource The resource builder for chaining.
Returns a handle; failures surface later via Err().
RunDatabaseUpdateOnStart() EFMigrationResourceReturns
EFMigrationResource The resource builder for chaining.
Returns a handle; failures surface later via Err().
WithMigrationNamespace(namespace string) EFMigrationResourceParameters
namespacestringThe namespace for generated migrations.Returns
EFMigrationResource The resource builder for chaining.
Returns a handle; failures surface later via Err().
WithMigrationOutputDirectory(outputDirectory string) EFMigrationResourceParameters
outputDirectory stringThe output directory path relative to the project root.Returns
EFMigrationResource The resource builder for chaining.
Returns a handle; failures surface later via Err().
WithMigrationsProject(options ...*WithMigrationsProjectOptions) EFMigrationResourceParameters
options...*WithMigrationsProjectOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*WithMigrationsProjectOptions argument.
MigrationsProject anyReturns
EFMigrationResource Returns a handle; failures surface later via Err().