From 78deba5190d128f28458ca03a181fb15ca3b8fd4 Mon Sep 17 00:00:00 2001 From: Jason Botwick Date: Fri, 26 Jan 2024 17:31:01 -0500 Subject: [PATCH] Fix PipelineNameComparer example in documentation (#1931) --- docs/advanced/dependency-injection.md | 2 +- src/Snippets/Docs/DependencyInjection.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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