diff --git a/src/Microsoft.Diagnostics.EventFlow.Outputs.ElasticSearch/ElasticSearchOutput.cs b/src/Microsoft.Diagnostics.EventFlow.Outputs.ElasticSearch/ElasticSearchOutput.cs index dd6f31e..62e0d9f 100644 --- a/src/Microsoft.Diagnostics.EventFlow.Outputs.ElasticSearch/ElasticSearchOutput.cs +++ b/src/Microsoft.Diagnostics.EventFlow.Outputs.ElasticSearch/ElasticSearchOutput.cs @@ -36,7 +36,7 @@ public class ElasticSearchOutput : IOutput private enum FormatIndexType {QuarterOfYear, WeekOfMonth, WeekOfYearDoubleDigit, WeekOfYear} - private class FormatIndex: IComparable + private class FormatIndex: IComparable, IEquatable { public FormatIndex(int index, FormatIndexType formatIndexType) { @@ -54,6 +54,17 @@ public int CompareTo(FormatIndex other) if (Index < other.Index) return 1; return Index > other.Index? -1 : 0; } + + public override bool Equals(object obj) + { + FormatIndex other = obj as FormatIndex; + if (other is null) return false; + return Index == other.Index; + } + + public bool Equals(FormatIndex other) => Index == other.Index; + + public override int GetHashCode() => Index.GetHashCode(); } private FormatIndex[] formatIndexes; diff --git a/src/Microsoft.Diagnostics.EventFlow.Outputs.ElasticSearch/Microsoft.Diagnostics.EventFlow.Outputs.ElasticSearch.csproj b/src/Microsoft.Diagnostics.EventFlow.Outputs.ElasticSearch/Microsoft.Diagnostics.EventFlow.Outputs.ElasticSearch.csproj index 6860413..4585266 100644 --- a/src/Microsoft.Diagnostics.EventFlow.Outputs.ElasticSearch/Microsoft.Diagnostics.EventFlow.Outputs.ElasticSearch.csproj +++ b/src/Microsoft.Diagnostics.EventFlow.Outputs.ElasticSearch/Microsoft.Diagnostics.EventFlow.Outputs.ElasticSearch.csproj @@ -3,7 +3,7 @@ Provides an output implementation that sends diagnostics data to Elasticsearch. © Microsoft Corporation. All rights reserved. - 2.7.5 + 2.7.6 Microsoft net471;netstandard2.0 Microsoft.Diagnostics.EventFlow.Outputs.ElasticSearch