mirror of https://github.com/abpframework/abp
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.
56 lines
1.5 KiB
56 lines
1.5 KiB
using AbpPerfTest.WithAbp.EntityFramework;
|
|
using Microsoft.AspNetCore.Builder;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Hosting;
|
|
using Volo.Abp;
|
|
using Volo.Abp.AspNetCore.Mvc;
|
|
using Volo.Abp.Autofac;
|
|
using Volo.Abp.EntityFrameworkCore;
|
|
using Volo.Abp.EntityFrameworkCore.SqlServer;
|
|
using Volo.Abp.Modularity;
|
|
using Volo.Abp.Uow;
|
|
|
|
namespace AbpPerfTest.WithAbp
|
|
{
|
|
[DependsOn(
|
|
typeof(AbpAspNetCoreMvcModule),
|
|
typeof(AbpAutofacModule),
|
|
typeof(AbpEntityFrameworkCoreSqlServerModule)
|
|
)]
|
|
public class AppModule : AbpModule
|
|
{
|
|
public override void ConfigureServices(ServiceConfigurationContext context)
|
|
{
|
|
context.Services.AddAbpDbContext<BookDbContext>(options =>
|
|
{
|
|
options.AddDefaultRepositories();
|
|
});
|
|
|
|
Configure<AbpDbContextOptions>(options =>
|
|
{
|
|
options.UseSqlServer();
|
|
});
|
|
|
|
Configure<AbpUnitOfWorkDefaultOptions>(options =>
|
|
{
|
|
options.TransactionBehavior = UnitOfWorkTransactionBehavior.Auto;
|
|
});
|
|
}
|
|
|
|
public override void OnApplicationInitialization(ApplicationInitializationContext context)
|
|
{
|
|
var app = context.GetApplicationBuilder();
|
|
var env = context.GetEnvironment();
|
|
|
|
if (env.IsDevelopment())
|
|
{
|
|
app.UseDeveloperExceptionPage();
|
|
}
|
|
|
|
app.UseRouting();
|
|
|
|
app.UseConfiguredEndpoints();
|
|
}
|
|
}
|
|
}
|