Watch Aspire live streamsDocsTry Aspire
Watch Aspire live streamsDocsTry

EFResourceBuilderExtensions Methods

ClassMethods8 members
Provides extension methods for adding EF Core migration management to projects.
AddEFMigrations(IResourceBuilder<ProjectResource>, string, string)Section titled AddEFMigrations(IResourceBuilder<ProjectResource>, string, string)extensionIResourceBuilder<EFMigrationResource>
Adds EF Core migration management for a specific DbContext type.
public static class EFResourceBuilderExtensions
{
public static IResourceBuilder<EFMigrationResource> AddEFMigrations(
this IResourceBuilder<ProjectResource> builder,
string name,
string dbContextTypeName)
{
// ...
}
}
builderIResourceBuilder<ProjectResource>The resource builder for the project.
namestringThe name of the migration resource.
dbContextTypeNamestringThe fully qualified name of the DbContext type to manage migrations for.
IResourceBuilder<EFMigrationResource>An EF migration resource builder for chaining additional configuration.
InvalidOperationExceptionThrown if migrations for this context type have already been added.
Multiple calls to this method with different context types are supported, allowing you to manage migrations for multiple DbContexts in the same project.
AddEFMigrations(IResourceBuilder<ProjectResource>, string, string, Action<IResourceBuilder<DotnetToolResource>>)Section titled AddEFMigrations(IResourceBuilder<ProjectResource>, string, string, Action<IResourceBuilder<DotnetToolResource>>)extensionIResourceBuilder<EFMigrationResource>
Adds EF Core migration management for a specific DbContext type.
public static class EFResourceBuilderExtensions
{
public static IResourceBuilder<EFMigrationResource> AddEFMigrations(
this IResourceBuilder<ProjectResource> builder,
string name,
string dbContextTypeName,
Action<IResourceBuilder<DotnetToolResource>>? configureToolResource)
{
// ...
}
}
builderIResourceBuilder<ProjectResource>The resource builder for the project.
namestringThe name of the migration resource.
dbContextTypeNamestringThe fully qualified name of the DbContext type to manage migrations for.
configureToolResourceAction<IResourceBuilder<DotnetToolResource>>Optional callback to configure the dotnet-ef tool resource used for migrations.
IResourceBuilder<EFMigrationResource>An EF migration resource builder for chaining additional configuration.
InvalidOperationExceptionThrown if migrations for this context type have already been added.
Multiple calls to this method with different context types are supported, allowing you to manage migrations for multiple DbContexts in the same project.
AddEFMigrations(IResourceBuilder<ProjectResource>, string)Section titled AddEFMigrations(IResourceBuilder<ProjectResource>, string)extensionIResourceBuilder<EFMigrationResource>
Adds EF Core migration management for the only DbContext type in the target project.
public static class EFResourceBuilderExtensions
{
public static IResourceBuilder<EFMigrationResource> AddEFMigrations(
this IResourceBuilder<ProjectResource> builder,
string name)
{
// ...
}
}
builderIResourceBuilder<ProjectResource>The resource builder for the project.
namestringThe name of the migration resource.
IResourceBuilder<EFMigrationResource>An EF migration resource builder for chaining additional configuration.
InvalidOperationExceptionThrown if migrations have already been added for any DbContext type on this project.
AddEFMigrations(IResourceBuilder<ProjectResource>, string, Action<IResourceBuilder<DotnetToolResource>>)Section titled AddEFMigrations(IResourceBuilder<ProjectResource>, string, Action<IResourceBuilder<DotnetToolResource>>)extensionIResourceBuilder<EFMigrationResource>
Adds EF Core migration management for the only DbContext type in the target project.
public static class EFResourceBuilderExtensions
{
public static IResourceBuilder<EFMigrationResource> AddEFMigrations(
this IResourceBuilder<ProjectResource> builder,
string name,
Action<IResourceBuilder<DotnetToolResource>>? configureToolResource)
{
// ...
}
}
builderIResourceBuilder<ProjectResource>The resource builder for the project.
namestringThe name of the migration resource.
configureToolResourceAction<IResourceBuilder<DotnetToolResource>>Optional callback to configure the dotnet-ef tool resource used for migrations.
IResourceBuilder<EFMigrationResource>An EF migration resource builder for chaining additional configuration.
InvalidOperationExceptionThrown if migrations have already been added for any DbContext type on this project.
AddEFMigrations(IResourceBuilder<IDotnetProgramResource>, string, string)Section titled AddEFMigrations(IResourceBuilder<IDotnetProgramResource>, string, string)extensionIResourceBuilder<EFMigrationResource>
Adds EF Core migration management for a specific DbContext type on a .NET program resource.
public static class EFResourceBuilderExtensions
{
public static IResourceBuilder<EFMigrationResource> AddEFMigrations(
this IResourceBuilder<IDotnetProgramResource> builder,
string name,
string dbContextTypeName)
{
// ...
}
}
builderIResourceBuilder<IDotnetProgramResource>The startup .NET program resource builder.
namestringThe name of the migration resource.
dbContextTypeNamestringThe fully qualified name of the DbContext type.
IResourceBuilder<EFMigrationResource>An EF migration resource builder for chaining additional configuration.
AddEFMigrations(IResourceBuilder<IDotnetProgramResource>, string, string, Action<IResourceBuilder<DotnetToolResource>>)Section titled AddEFMigrations(IResourceBuilder<IDotnetProgramResource>, string, string, Action<IResourceBuilder<DotnetToolResource>>)extensionIResourceBuilder<EFMigrationResource>
Adds EF Core migration management for a specific DbContext type on a .NET program resource.
public static class EFResourceBuilderExtensions
{
public static IResourceBuilder<EFMigrationResource> AddEFMigrations(
this IResourceBuilder<IDotnetProgramResource> builder,
string name,
string dbContextTypeName,
Action<IResourceBuilder<DotnetToolResource>>? configureToolResource)
{
// ...
}
}
builderIResourceBuilder<IDotnetProgramResource>The startup .NET program resource builder.
namestringThe name of the migration resource.
dbContextTypeNamestringThe fully qualified name of the DbContext type.
configureToolResourceAction<IResourceBuilder<DotnetToolResource>>An optional callback that configures the dotnet-ef tool resource.
IResourceBuilder<EFMigrationResource>An EF migration resource builder for chaining additional configuration.
AddEFMigrations(IResourceBuilder<IDotnetProgramResource>, string)Section titled AddEFMigrations(IResourceBuilder<IDotnetProgramResource>, string)extensionIResourceBuilder<EFMigrationResource>
Adds EF Core migration management for the only DbContext type in a .NET program resource.
public static class EFResourceBuilderExtensions
{
public static IResourceBuilder<EFMigrationResource> AddEFMigrations(
this IResourceBuilder<IDotnetProgramResource> builder,
string name)
{
// ...
}
}
builderIResourceBuilder<IDotnetProgramResource>The startup .NET program resource builder.
namestringThe name of the migration resource.
IResourceBuilder<EFMigrationResource>An EF migration resource builder for chaining additional configuration.
AddEFMigrations(IResourceBuilder<IDotnetProgramResource>, string, Action<IResourceBuilder<DotnetToolResource>>)Section titled AddEFMigrations(IResourceBuilder<IDotnetProgramResource>, string, Action<IResourceBuilder<DotnetToolResource>>)extensionIResourceBuilder<EFMigrationResource>
Adds EF Core migration management for the only DbContext type in a .NET program resource.
public static class EFResourceBuilderExtensions
{
public static IResourceBuilder<EFMigrationResource> AddEFMigrations(
this IResourceBuilder<IDotnetProgramResource> builder,
string name,
Action<IResourceBuilder<DotnetToolResource>>? configureToolResource)
{
// ...
}
}
builderIResourceBuilder<IDotnetProgramResource>The startup .NET program resource builder.
namestringThe name of the migration resource.
configureToolResourceAction<IResourceBuilder<DotnetToolResource>>An optional callback that configures the dotnet-ef tool resource.
IResourceBuilder<EFMigrationResource>An EF migration resource builder for chaining additional configuration.