diff --git a/src/CMSMicroservice.Infrastructure/Persistence/ApplicationDbContext.cs b/src/CMSMicroservice.Infrastructure/Persistence/ApplicationDbContext.cs index 7f2d668..9f42582 100644 --- a/src/CMSMicroservice.Infrastructure/Persistence/ApplicationDbContext.cs +++ b/src/CMSMicroservice.Infrastructure/Persistence/ApplicationDbContext.cs @@ -1,5 +1,6 @@ using System.Reflection; using CMSMicroservice.Application.Common.Interfaces; +using Microsoft.EntityFrameworkCore.Diagnostics; using CMSMicroservice.Domain.Entities; using CMSMicroservice.Domain.Entities.Payment; @@ -39,6 +40,9 @@ public class ApplicationDbContext : DbContext, IApplicationDbContext protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.AddInterceptors(_auditableEntitySaveChangesInterceptor); + + // Suppress PendingModelChangesWarning in EF Core 9 + optionsBuilder.ConfigureWarnings(w => w.Ignore(RelationalEventId.PendingModelChangesWarning)); } public override async Task SaveChangesAsync(CancellationToken cancellationToken = default)