8000 prevent ManyServiceProvidersCreatedWarning in unit test · devel0/example-webapp-with-auth@bbfdab6 · GitHub
[go: up one dir, main page]

Skip to content

Commit bbfdab6

Browse files
committed
prevent ManyServiceProvidersCreatedWarning in unit test
1 parent 413e277 commit bbfdab6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/backend/webapi/Extensions/DatabaseService.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ public static void ConfigureDatabase(this WebApplicationBuilder webApplicationBu
4040
default: throw new NotImplementedException($"provider {provider} not implemented");
4141
}
4242

43-
options
44-
.EnableSensitiveDataLogging();
43+
options.EnableSensitiveDataLogging();
44+
45+
if (isUnitTest)
46+
options.EnableServiceProviderCaching(false);
4547

4648
});
4749
}

0 commit comments

Comments
 (0)
0