|
|
|
@ -1,4 +1,5 @@ |
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
using Microsoft.EntityFrameworkCore.Diagnostics; |
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
using Microsoft.Extensions.DependencyInjection.Extensions; |
|
|
|
using Volo.Abp.Domain; |
|
|
|
using Volo.Abp.Modularity; |
|
|
|
@ -11,6 +12,18 @@ namespace Volo.Abp.EntityFrameworkCore |
|
|
|
{ |
|
|
|
public override void ConfigureServices(IServiceCollection services) |
|
|
|
{ |
|
|
|
services.Configure<AbpDbContextOptions>(options => |
|
|
|
{ |
|
|
|
options.PreConfigure(context => |
|
|
|
{ |
|
|
|
context.DbContextOptions |
|
|
|
.ConfigureWarnings(warnings => |
|
|
|
{ |
|
|
|
warnings.Ignore(CoreEventId.LazyLoadOnDisposedContextWarning); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
services.TryAddTransient(typeof(IDbContextProvider<>), typeof(UnitOfWorkDbContextProvider<>)); |
|
|
|
services.AddAssemblyOf<AbpEntityFrameworkCoreModule>(); |
|
|
|
} |
|
|
|
|