Browse Source

Ignore CoreEventId.LazyLoadOnDisposedContextWarning

pull/272/head
Halil İbrahim Kalkan 8 years ago
parent
commit
1758b8a780
  1. 15
      src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpEntityFrameworkCoreModule.cs

15
src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpEntityFrameworkCoreModule.cs

@ -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>();
}

Loading…
Cancel
Save