diff --git a/docs/advanced/dependency-injection.md b/docs/advanced/dependency-injection.md index f7396cd39a6..4e7496ad04b 100644 --- a/docs/advanced/dependency-injection.md +++ b/docs/advanced/dependency-injection.md @@ -291,7 +291,7 @@ public sealed class PipelineNameComparer : IEqualityComparer { public bool Equals(MyPipelineKey x, MyPipelineKey y) => x.PipelineName == y.PipelineName; - public int GetHashCode(MyPipelineKey obj) => (obj.PipelineName, obj.InstanceName).GetHashCode(); + public int GetHashCode(MyPipelineKey obj) => obj.PipelineName.GetHashCode(); } ``` diff --git a/src/Snippets/Docs/DependencyInjection.cs b/src/Snippets/Docs/DependencyInjection.cs index 0ed345bdc5a..5ae5f1c1d19 100644 --- a/src/Snippets/Docs/DependencyInjection.cs +++ b/src/Snippets/Docs/DependencyInjection.cs @@ -225,7 +225,7 @@ public sealed class PipelineNameComparer : IEqualityComparer { public bool Equals(MyPipelineKey x, MyPipelineKey y) => x.PipelineName == y.PipelineName; - public int GetHashCode(MyPipelineKey obj) => (obj.PipelineName, obj.InstanceName).GetHashCode(); + public int GetHashCode(MyPipelineKey obj) => obj.PipelineName.GetHashCode(StringComparison.Ordinal); } #endregion