/
aprogrammer
/
reverse-proxy-ms-yarp
Обзор
Документация
Войти
/
aprogrammer
/
reverse-proxy-ms-yarp
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/ReverseProxy/Configuration/HealthCheckConfig.cs
47 строк
1 KB
Kahbazi
Use is null instead of == null (#1565)
29 мар 2022, 02:51
Не верифицирован
29 мар 2022, 02:51
9bbdf5e
Код
Авторство
О чём код?
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; namespace Yarp.ReverseProxy.Configuration; /// <summary> /// All health check config. /// </summary> public sealed record HealthCheckConfig { /// <summary> /// Passive health check config. /// </summary> public PassiveHealthCheckConfig? Passive { get; init; } /// <summary> /// Active health check config. /// </summary> public ActiveHealthCheckConfig? Active { get; init; } /// <summary> /// Available destinations policy. /// </summary> public string? AvailableDestinationsPolicy { get; init; } public bool Equals(HealthCheckConfig? other) { if (other is null) { return false; } return Passive == other.Passive && Active == other.Active && string.Equals(AvailableDestinationsPolicy, other.AvailableDestinationsPolicy, StringComparison.OrdinalIgnoreCase); } public override int GetHashCode() { return HashCode.Combine( Passive, Active, AvailableDestinationsPolicy?.GetHashCode(StringComparison.OrdinalIgnoreCase)); } }