Skip to content

Commit

Permalink
Fix default warning configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
roji committed Sep 14, 2022
1 parent 310ad64 commit 818dfee
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,7 @@ private static void ConfigureWarnings(DbContextOptionsBuilder optionsBuilder)
var coreOptionsExtension = optionsBuilder.Options.FindExtension<CoreOptionsExtension>()
?? new CoreOptionsExtension();

coreOptionsExtension = coreOptionsExtension.WithWarningsConfiguration(
coreOptionsExtension.WarningsConfiguration.TryWithExplicit(
RelationalEventId.AmbientTransactionWarning, WarningBehavior.Throw));
coreOptionsExtension = RelationalOptionsExtension.WithDefaultWarningConfiguration(coreOptionsExtension);

((IDbContextOptionsBuilderInfrastructure)optionsBuilder).AddOrUpdateExtension(coreOptionsExtension);
}
Expand Down

0 comments on commit 818dfee

Please sign in to comment.