The DTM implementation module of ABP distributed event boxes.
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.

22 lines
633 B

using AppHttpSample.Entities;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
namespace AppHttpSample;
public class TestDataSeed : IDataSeedContributor, ITransientDependency
{
private readonly IServiceProvider _serviceProvider;
public TestDataSeed(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;
}
public async Task SeedAsync(DataSeedContext context)
{
using var scope = _serviceProvider.CreateScope();
var testDbContext = scope.ServiceProvider.GetRequiredService<TestDbContext>();
await testDbContext.Database.EnsureCreatedAsync();
}
}