/
githubmirror
/
aspnetcore
Обзор
Документация
Войти
/
githubmirror
/
aspnetcore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/SignalR/common/testassets/Tests.Utils/HubConnectionBuilderTestExtensions.cs
20 строк
883 B
James Newton-King
Enable throw helper analyzers (#45954)
10 янв 2023, 03:52
Не верифицирован
10 янв 2023, 03:52
c096dbb
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; namespace Microsoft.AspNetCore.SignalR.Client; public static class HubConnectionBuilderTestExtensions { // Tests want to override the built in LoggerFactory, it internally calls AddLogging // https://github.com/aspnet/Logging/blob/671af986ec3b46dc81e28e4a6c37a9d0ee283c65/src/Microsoft.Extensions.Logging.Testing/AssemblyTestLog.cs#L130 public static IHubConnectionBuilder WithLoggerFactory(this IHubConnectionBuilder hubConnectionBuilder, ILoggerFactory loggerFactory) { ArgumentNullException.ThrowIfNull(loggerFactory); hubConnectionBuilder.Services.AddSingleton(loggerFactory); return hubConnectionBuilder; } }