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.
abp/test/Volo.Abp.TestApp/Volo/Abp/TestApp/TestAppModule.cs

45 lines
1.4 KiB

using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Modularity;
using Volo.Abp.TestApp.Domain;
using Volo.Abp.AutoMapper;
using Volo.Abp.TestApp.Application;
namespace Volo.Abp.TestApp
{
[DependsOn(typeof(AbpAutoMapperModule))]
public class TestAppModule : AbpModule
{
public override void ConfigureServices(IServiceCollection services)
{
ConfigureAutoMapper(services);
services.AddAssemblyOf<TestAppModule>();
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
8 years ago
SeedTestData(context);
}
private static void ConfigureAutoMapper(IServiceCollection services)
{
services.Configure<AbpAutoMapperOptions>(options =>
{
options.Configurators.Add((IAbpAutoMapperConfigurationContext ctx) =>
{
ctx.MapperConfiguration.CreateMap<Person, PersonDto>().ReverseMap();
});
});
}
8 years ago
private static void SeedTestData(ApplicationInitializationContext context)
{
using (IServiceScope scope = context.ServiceProvider.CreateScope())
{
8 years ago
scope.ServiceProvider
.GetRequiredService<TestDataBuilder>()
.Build();
}
}
}
}