Skip to content

Class EntityFrameworkDatabaseMigrationHostedService

Namespace: Cephalon.Data.EntityFramework.Services
Assembly: Cephalon.Data.EntityFramework.dll

Applies startup schema changes for Entity Framework Core database-role targets selected through Engine:Databases.

public sealed class EntityFrameworkDatabaseMigrationHostedService : IHostedService

objectEntityFrameworkDatabaseMigrationHostedService

IHostedService

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

EntityFrameworkDatabaseMigrationHostedService(IServiceProvider, AppProfile, IEnumerable<EntityFrameworkDatabaseMigrationRegistration>)

Section titled “ EntityFrameworkDatabaseMigrationHostedService(IServiceProvider, AppProfile, IEnumerable<EntityFrameworkDatabaseMigrationRegistration>)”

Applies startup schema changes for Entity Framework Core database-role targets selected through Engine:Databases.

public EntityFrameworkDatabaseMigrationHostedService(IServiceProvider serviceProvider, AppProfile appProfile, IEnumerable<EntityFrameworkDatabaseMigrationRegistration> registrations)

serviceProvider IServiceProvider

appProfile AppProfile

registrations IEnumerable<EntityFrameworkDatabaseMigrationRegistration>

Applies the configured startup migration policy for every targeted Entity Framework database role.

public Task StartAsync(CancellationToken cancellationToken)

cancellationToken CancellationToken

The token that cancels startup migration execution.

Task

Stops the hosted service. Entity Framework startup migration execution is synchronous during startup, so there is no background work to drain.

public Task StopAsync(CancellationToken cancellationToken)

cancellationToken CancellationToken

The token that cancels shutdown.

Task

A completed task.