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) { // ... }}Parameters
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.Returns
IResourceBuilder<EFMigrationResource>An EF migration resource builder for chaining additional configuration.Exceptions
InvalidOperationExceptionThrown if migrations for this context type have already been added.Remarks
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) { // ... }}Parameters
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.Returns
IResourceBuilder<EFMigrationResource>An EF migration resource builder for chaining additional configuration.Exceptions
InvalidOperationExceptionThrown if migrations for this context type have already been added.Remarks
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) { // ... }}Parameters
builderIResourceBuilder<ProjectResource>The resource builder for the project.namestringThe name of the migration resource.Returns
IResourceBuilder<EFMigrationResource>An EF migration resource builder for chaining additional configuration.Exceptions
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) { // ... }}Parameters
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.Returns
IResourceBuilder<EFMigrationResource>An EF migration resource builder for chaining additional configuration.Exceptions
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) { // ... }}Parameters
builderIResourceBuilder<IDotnetProgramResource>The startup .NET program resource builder.namestringThe name of the migration resource.dbContextTypeNamestringThe fully qualified name of the DbContext type.Returns
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) { // ... }}Parameters
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.Returns
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) { // ... }}Parameters
builderIResourceBuilder<IDotnetProgramResource>The startup .NET program resource builder.namestringThe name of the migration resource.Returns
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) { // ... }}Parameters
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.Returns
IResourceBuilder<EFMigrationResource>An EF migration resource builder for chaining additional configuration.