From 32e37804a556b8bc667e1938dabbefbce1ac40b1 Mon Sep 17 00:00:00 2001 From: token <239573049@qq.com> Date: Sun, 10 Nov 2024 23:12:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/NuGet.Next.DM/DMApplicationExtensions.cs | 3 +++ src/NuGet.Next.MySql/MySqlApplicationExtensions.cs | 3 +++ src/NuGet.Next.PostgreSql/PostgreSqlApplicationExtensions.cs | 2 ++ src/NuGet.Next.SqlServer/SqlServerApplicationExtensions.cs | 2 ++ src/NuGet.Next.Sqlite/SqliteApplicationExtensions.cs | 3 +++ 5 files changed, 13 insertions(+) diff --git a/src/NuGet.Next.DM/DMApplicationExtensions.cs b/src/NuGet.Next.DM/DMApplicationExtensions.cs index 4ed08a1..5409ecb 100644 --- a/src/NuGet.Next.DM/DMApplicationExtensions.cs +++ b/src/NuGet.Next.DM/DMApplicationExtensions.cs @@ -1,5 +1,6 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging.Abstractions; using NuGet.Next.Core; using NuGet.Next.Options; @@ -14,6 +15,8 @@ public static BaGetApplication AddDMDatabase(this BaGetApplication app) var databaseOptions = provider.GetRequiredService(); options.UseDm(databaseOptions.Database.ConnectionString); + + options.UseLoggerFactory((new NullLoggerFactory())); }); return app; diff --git a/src/NuGet.Next.MySql/MySqlApplicationExtensions.cs b/src/NuGet.Next.MySql/MySqlApplicationExtensions.cs index a606fa7..138e622 100644 --- a/src/NuGet.Next.MySql/MySqlApplicationExtensions.cs +++ b/src/NuGet.Next.MySql/MySqlApplicationExtensions.cs @@ -1,5 +1,6 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using NuGet.Next.Core; using NuGet.Next.Options; @@ -16,6 +17,8 @@ public static BaGetApplication AddMySqlDatabase(this BaGetApplication app) options.UseMySql(databaseOptions.Database.ConnectionString, ServerVersion.AutoDetect(databaseOptions.Database.ConnectionString)); + + options.UseLoggerFactory((new NullLoggerFactory())); }); return app; diff --git a/src/NuGet.Next.PostgreSql/PostgreSqlApplicationExtensions.cs b/src/NuGet.Next.PostgreSql/PostgreSqlApplicationExtensions.cs index 484a805..080240c 100644 --- a/src/NuGet.Next.PostgreSql/PostgreSqlApplicationExtensions.cs +++ b/src/NuGet.Next.PostgreSql/PostgreSqlApplicationExtensions.cs @@ -1,5 +1,6 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging.Abstractions; using NuGet.Next.Core; using NuGet.Next.Options; @@ -17,6 +18,7 @@ public static BaGetApplication AddPostgreSqlDatabase(this BaGetApplication app) var databaseOptions = provider.GetRequiredService(); options.UseNpgsql(databaseOptions.Database.ConnectionString); + options.UseLoggerFactory((new NullLoggerFactory())); }); return app; diff --git a/src/NuGet.Next.SqlServer/SqlServerApplicationExtensions.cs b/src/NuGet.Next.SqlServer/SqlServerApplicationExtensions.cs index 3e24e25..c7a4788 100644 --- a/src/NuGet.Next.SqlServer/SqlServerApplicationExtensions.cs +++ b/src/NuGet.Next.SqlServer/SqlServerApplicationExtensions.cs @@ -1,5 +1,6 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging.Abstractions; using NuGet.Next.Core; using NuGet.Next.Options; @@ -15,6 +16,7 @@ public static BaGetApplication AddSqlServerDatabase(this BaGetApplication app) var databaseOptions = provider.GetRequiredService(); options.UseSqlServer(databaseOptions.Database.ConnectionString); + options.UseLoggerFactory((new NullLoggerFactory())); }); return app; diff --git a/src/NuGet.Next.Sqlite/SqliteApplicationExtensions.cs b/src/NuGet.Next.Sqlite/SqliteApplicationExtensions.cs index fc0f984..1ae4b60 100644 --- a/src/NuGet.Next.Sqlite/SqliteApplicationExtensions.cs +++ b/src/NuGet.Next.Sqlite/SqliteApplicationExtensions.cs @@ -1,5 +1,6 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging.Abstractions; using NuGet.Next.Core; using NuGet.Next.Options; using NuGet.Next.Sqlite; @@ -14,6 +15,8 @@ public static BaGetApplication AddSqliteDatabase(this BaGetApplication app) { var option = provider.GetRequiredService(); options.UseSqlite(option.Database.ConnectionString); + + options.UseLoggerFactory((new NullLoggerFactory())); }); return app;