Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove StringComparison.OrdinalIgnoreCase as EF Core translation #1995

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ internal sealed class HealthCheckReportCollector : IHealthCheckReportCollector,
new JsonStringEnumConverter(namingPolicy: null, allowIntegerValues: true)
}
};
private bool _disposed;
private bool _disposed;

public HealthCheckReportCollector(
HealthChecksDb db,
Expand Down Expand Up @@ -107,7 +107,7 @@ public void Dispose()

_httpClient.Dispose();
_disposed = true;
}
}

private async Task<UIHealthReport> GetHealthReportAsync(HealthCheckConfiguration configuration)
{
Expand Down Expand Up @@ -198,10 +198,12 @@ private async Task<bool> HasLivenessRecoveredFromFailureAsync(HealthCheckConfigu

private async Task<bool> ShouldNotifyAsync(string healthCheckName)
{
#pragma warning disable RCS1155 // Use StringComparison when comparing strings.
sungam3r marked this conversation as resolved.
Show resolved Hide resolved
var lastNotifications = await _db.Failures
.Where(lf => string.Equals(lf.HealthCheckName, healthCheckName, StringComparison.OrdinalIgnoreCase))
.Where(lf => string.Equals(lf.HealthCheckName, healthCheckName))
.OrderByDescending(lf => lf.LastNotified)
.Take(2).ToListAsync();
#pragma warning restore RCS1155 // Use StringComparison when comparing strings.

if (lastNotifications?.Count == 2)
{
Expand Down Expand Up @@ -331,5 +333,5 @@ private void ThrowIfDisposed()
{
throw new ObjectDisposedException(GetType().FullName);
}
}
}
}