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.
21 lines
494 B
21 lines
494 B
using Microsoft.Extensions.Hosting; |
|
using System.Threading; |
|
using System.Threading.Tasks; |
|
using Volo.Abp.Data; |
|
|
|
namespace BookStore.DataSeeder; |
|
|
|
public class BookStoreDataSeederWorker : BackgroundService |
|
{ |
|
protected IDataSeeder DataSeeder { get; } |
|
|
|
public BookStoreDataSeederWorker(IDataSeeder dataSeeder) |
|
{ |
|
DataSeeder = dataSeeder; |
|
} |
|
|
|
protected async override Task ExecuteAsync(CancellationToken stoppingToken) |
|
{ |
|
await DataSeeder.SeedAsync(); |
|
} |
|
} |