You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

30 lines
770 B

using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
namespace EShopOnAbp.DbMigrator;
public class MigrationService: ITransientDependency
{
private readonly ILogger<MigrationService> _logger;
private readonly IDataSeeder _dataSeeder;
public MigrationService(ILogger<MigrationService> logger, IDataSeeder dataSeeder)
{
_logger = logger;
_dataSeeder = dataSeeder;
}
public async Task MigrateAsync(CancellationToken cancellationToken)
{
// Check if keycloak api is available
//Seed data
await _dataSeeder.SeedAsync();
_logger.LogInformation("Migration completed!");
}
}