Example #1
0
        public Task CheckedAsync(string serviceName, HealthCheckStatus newStatus)
        {
            if (string.IsNullOrWhiteSpace(serviceName))
            {
                throw new ArgumentException(nameof(serviceName));
            }

            if (newStatus == null)
            {
                throw new ArgumentNullException(nameof(newStatus));
            }

            _checks.AddOrUpdate(serviceName, newStatus, (key, existingStatus) =>
                                existingStatus.DateTime > newStatus.DateTime ? existingStatus : newStatus);

            return(Task.CompletedTask);
        }
 protected bool Equals(HealthCheckStatus other)
 {
     return(Status == other.Status && DateTime.Equals(other.DateTime) && ErrorMessage == other.ErrorMessage);
 }