EFResourceBuilderExtensions Methods
AddEFMigrations(IResourceBuilder<ProjectResource>, string, string) Section titled AddEFMigrations(IResourceBuilder<ProjectResource>, string, string) extension IResourceBuilder<EFMigrationResource> public static class EFResourceBuilderExtensions{ public static IResourceBuilder<EFMigrationResource> AddEFMigrations( this IResourceBuilder<ProjectResource> builder, string name, string dbContextTypeName) { // ... }}Parameters
builder IResourceBuilder<ProjectResource> The resource builder for the project. name string The name of the migration resource. dbContextTypeName string The fully qualified name of the DbContext type to manage migrations for. Returns
IResourceBuilder<EFMigrationResource> An EF migration resource builder for chaining additional configuration. Exceptions
InvalidOperationException Thrown 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.
This overload is useful when the DbContext type is not available at compile time, such as when using runtime-discovered context types.
AddEFMigrations(IResourceBuilder<ProjectResource>, string, string, Action<IResourceBuilder<DotnetToolResource>>) Section titled AddEFMigrations(IResourceBuilder<ProjectResource>, string, string, Action<IResourceBuilder<DotnetToolResource>>) extension IResourceBuilder<EFMigrationResource> public static class EFResourceBuilderExtensions{ public static IResourceBuilder<EFMigrationResource> AddEFMigrations( this IResourceBuilder<ProjectResource> builder, string name, string dbContextTypeName, Action<IResourceBuilder<DotnetToolResource>>? configureToolResource) { // ... }}Parameters
builder IResourceBuilder<ProjectResource> The resource builder for the project. name string The name of the migration resource. dbContextTypeName string The fully qualified name of the DbContext type to manage migrations for. configureToolResource Action<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
InvalidOperationException Thrown 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.
This overload is useful when the DbContext type is not available at compile time, such as when using runtime-discovered context types.
AddEFMigrations(IResourceBuilder<ProjectResource>, string) Section titled AddEFMigrations(IResourceBuilder<ProjectResource>, string) extension IResourceBuilder<EFMigrationResource> public static class EFResourceBuilderExtensions{ public static IResourceBuilder<EFMigrationResource> AddEFMigrations( this IResourceBuilder<ProjectResource> builder, string name) { // ... }}Parameters
builder IResourceBuilder<ProjectResource> The resource builder for the project. name string The name of the migration resource. Returns
IResourceBuilder<EFMigrationResource> An EF migration resource builder for chaining additional configuration. AddEFMigrations(IResourceBuilder<ProjectResource>, string, Action<IResourceBuilder<DotnetToolResource>>) Section titled AddEFMigrations(IResourceBuilder<ProjectResource>, string, Action<IResourceBuilder<DotnetToolResource>>) extension IResourceBuilder<EFMigrationResource> public static class EFResourceBuilderExtensions{ public static IResourceBuilder<EFMigrationResource> AddEFMigrations( this IResourceBuilder<ProjectResource> builder, string name, Action<IResourceBuilder<DotnetToolResource>>? configureToolResource) { // ... }}Parameters
builder IResourceBuilder<ProjectResource> The resource builder for the project. name string The name of the migration resource. configureToolResource Action<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.