Skip to content

Commit 0ef5f4a

Browse files
committed
Made CacheKey constant
1 parent 4d32718 commit 0ef5f4a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

HttpClient.Caching/InMemory/InMemoryCacheHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class InMemoryCacheHandler : DelegatingHandler
2222
/// If the key is present and the value is false, the cache will not be checked.
2323
/// If the key is present and the value is true, the cache will be checked.
2424
/// </summary>
25-
public readonly static HttpRequestOptionsKey<bool> UseCache = new("UseCache");
25+
public readonly static HttpRequestOptionsKey<bool> UseCache = new(nameof(UseCache));
2626
#else
2727
/// <summary>
2828
/// The key to use to store the UseCache value in the HttpRequestMessage.Properties dictionary.
@@ -31,7 +31,7 @@ public class InMemoryCacheHandler : DelegatingHandler
3131
/// If the key is present and the value is false, the cache will not be checked.
3232
/// If the key is present and the value is true, the cache will be checked.
3333
/// </summary>
34-
public const string UseCache = "UseCache";
34+
public const string UseCache = nameof(UseCache);
3535
#endif
3636

3737
private static HashSet<HttpMethod> CachedHttpMethods = new HashSet<HttpMethod>

0 commit comments

Comments
 (0)