From c324a34fb745a045026296641b563c495927da5a Mon Sep 17 00:00:00 2001 From: MrDave1999 Date: Wed, 28 Dec 2022 18:45:24 -0500 Subject: [PATCH] Suppress the warning of possible incorrect required navigation with query filter interaction --- src/DataAccess/AppDbContext.cs | 7 ++++++- src/GlobalUsings.cs | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/DataAccess/AppDbContext.cs b/src/DataAccess/AppDbContext.cs index f8d5fce1..e7f8926f 100644 --- a/src/DataAccess/AppDbContext.cs +++ b/src/DataAccess/AppDbContext.cs @@ -5,7 +5,12 @@ public partial class AppDbContext : CustomDbContext public AppDbContext(DbContextOptions options) : base(options) { } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) - => optionsBuilder.AddDelegateDecompiler(); + { + optionsBuilder.ConfigureWarnings(warnings => + // See https://github.com/DentallApp/back-end/issues/25. + warnings.Ignore(CoreEventId.PossibleIncorrectRequiredNavigationWithQueryFilterInteractionWarning)); + optionsBuilder.AddDelegateDecompiler(); + } protected override void OnModelCreating(ModelBuilder modelBuilder) { diff --git a/src/GlobalUsings.cs b/src/GlobalUsings.cs index c4195ddf..1ecdd1a6 100644 --- a/src/GlobalUsings.cs +++ b/src/GlobalUsings.cs @@ -110,6 +110,7 @@ global using Microsoft.EntityFrameworkCore; +global using Microsoft.EntityFrameworkCore.Diagnostics; global using Microsoft.EntityFrameworkCore.Metadata.Builders; global using Microsoft.EntityFrameworkCore.Query.SqlExpressions; global using Microsoft.EntityFrameworkCore.Storage;