forked from tsai/eShopOnAbp
6 changed files with 68 additions and 11 deletions
@ -0,0 +1,11 @@ |
|||
using Volo.Abp.Domain.Entities.Events.Distributed; |
|||
using Volo.Abp.EventBus; |
|||
|
|||
namespace EShopOnAbp.IdentityService.DbMigrations |
|||
{ |
|||
|
|||
[EventName("abp.data.apply_database_migrations")] |
|||
public class ApplyDatabaseSeedsEto : EtoBase |
|||
{ |
|||
} |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.EventBus; |
|||
|
|||
namespace EShopOnAbp.IdentityService.DbMigrations |
|||
{ |
|||
public class DataSeederEventHandler : ILocalEventHandler<ApplyDatabaseSeedsEto>, ITransientDependency |
|||
{ |
|||
protected IDataSeeder DataSeeder { get; } |
|||
|
|||
public DataSeederEventHandler(IDataSeeder dataSeeder) |
|||
{ |
|||
DataSeeder = dataSeeder; |
|||
} |
|||
|
|||
public async Task HandleEventAsync(ApplyDatabaseSeedsEto eventData) |
|||
{ |
|||
await DataSeeder.SeedAsync(); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue