From e20c300ee3189644a503fe20671efc9922ce0663 Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Wed, 8 Aug 2018 11:18:09 -0700 Subject: [PATCH 1/3] Adding documentation comments --- .../DistributedCacheEntryOptions.cs | 3 ++ .../IDistributedCache.cs | 49 +++++++++++++++++++ .../MemoryCacheEntryOptions.cs | 3 ++ 3 files changed, 55 insertions(+) diff --git a/src/Microsoft.Extensions.Caching.Abstractions/DistributedCacheEntryOptions.cs b/src/Microsoft.Extensions.Caching.Abstractions/DistributedCacheEntryOptions.cs index 4b8772a6..cef896fb 100644 --- a/src/Microsoft.Extensions.Caching.Abstractions/DistributedCacheEntryOptions.cs +++ b/src/Microsoft.Extensions.Caching.Abstractions/DistributedCacheEntryOptions.cs @@ -5,6 +5,9 @@ namespace Microsoft.Extensions.Caching.Distributed { + /// + /// Represents the cache options applied to an entries of the instance. + /// public class DistributedCacheEntryOptions { private DateTimeOffset? _absoluteExpiration; diff --git a/src/Microsoft.Extensions.Caching.Abstractions/IDistributedCache.cs b/src/Microsoft.Extensions.Caching.Abstractions/IDistributedCache.cs index 34e25760..5194b311 100644 --- a/src/Microsoft.Extensions.Caching.Abstractions/IDistributedCache.cs +++ b/src/Microsoft.Extensions.Caching.Abstractions/IDistributedCache.cs @@ -6,22 +6,71 @@ namespace Microsoft.Extensions.Caching.Distributed { + /// + /// Represents a distributed cache of serialized values. + /// public interface IDistributedCache { + /// + /// Gets a value with the given key. + /// + /// A string identifying the requested value. + /// The located value or null. byte[] Get(string key); + /// + /// Gets a value with the given key. + /// + /// A string identifying the requested value. + /// Optional. The used to propagate notifications that the operation should be canceled. + /// The that represents the asynchronous operation, containing the located value or null. Task GetAsync(string key, CancellationToken token = default(CancellationToken)); + /// + /// Sets a value with the given key. + /// + /// A string identifying the requested value. + /// The value to set in the cache. + /// The cache options for the value. + /// The located value or null. void Set(string key, byte[] value, DistributedCacheEntryOptions options); + /// + /// Sets the value with the given key. + /// + /// A string identifying the requested value. + /// The value to set in the cache. + /// The cache options for the value. + /// Optional. The used to propagate notifications that the operation should be canceled. + /// The that represents the asynchronous operation. Task SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token = default(CancellationToken)); + /// + /// Refreshes a value in the cache based on its key, resetting its sliding expiration timeout (if any). + /// + /// A string identifying the requested entry. void Refresh(string key); + /// + /// Refreshes a value in the cache based on its key, resetting its sliding expiration timeout (if any). + /// + /// A string identifying the requested value. + /// Optional. The used to propagate notifications that the operation should be canceled. + /// The that represents the asynchronous operation. Task RefreshAsync(string key, CancellationToken token = default(CancellationToken)); + /// + /// Removes the value with the given key. + /// + /// A string identifying the requested value. void Remove(string key); + /// + /// Removes the value with the given key. + /// + /// A string identifying the requested value. + /// Optional. The used to propagate notifications that the operation should be canceled. + /// The that represents the asynchronous operation. Task RemoveAsync(string key, CancellationToken token = default(CancellationToken)); } } \ No newline at end of file diff --git a/src/Microsoft.Extensions.Caching.Abstractions/MemoryCacheEntryOptions.cs b/src/Microsoft.Extensions.Caching.Abstractions/MemoryCacheEntryOptions.cs index 3514c7ee..95739632 100644 --- a/src/Microsoft.Extensions.Caching.Abstractions/MemoryCacheEntryOptions.cs +++ b/src/Microsoft.Extensions.Caching.Abstractions/MemoryCacheEntryOptions.cs @@ -7,6 +7,9 @@ namespace Microsoft.Extensions.Caching.Memory { + /// + /// Represents the cache options applied to an entries of the instance. + /// public class MemoryCacheEntryOptions { private DateTimeOffset? _absoluteExpiration; From 0e968f40e646da453f7847304457c972ab7b31de Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Wed, 8 Aug 2018 11:26:12 -0700 Subject: [PATCH 2/3] Typos --- .../DistributedCacheEntryOptions.cs | 2 +- .../IDistributedCache.cs | 3 +-- .../MemoryCacheEntryOptions.cs | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.Extensions.Caching.Abstractions/DistributedCacheEntryOptions.cs b/src/Microsoft.Extensions.Caching.Abstractions/DistributedCacheEntryOptions.cs index cef896fb..d2fdb4d0 100644 --- a/src/Microsoft.Extensions.Caching.Abstractions/DistributedCacheEntryOptions.cs +++ b/src/Microsoft.Extensions.Caching.Abstractions/DistributedCacheEntryOptions.cs @@ -6,7 +6,7 @@ namespace Microsoft.Extensions.Caching.Distributed { /// - /// Represents the cache options applied to an entries of the instance. + /// Represents the cache options applied to an entry of the instance. /// public class DistributedCacheEntryOptions { diff --git a/src/Microsoft.Extensions.Caching.Abstractions/IDistributedCache.cs b/src/Microsoft.Extensions.Caching.Abstractions/IDistributedCache.cs index 5194b311..efc61169 100644 --- a/src/Microsoft.Extensions.Caching.Abstractions/IDistributedCache.cs +++ b/src/Microsoft.Extensions.Caching.Abstractions/IDistributedCache.cs @@ -32,7 +32,6 @@ public interface IDistributedCache /// A string identifying the requested value. /// The value to set in the cache. /// The cache options for the value. - /// The located value or null. void Set(string key, byte[] value, DistributedCacheEntryOptions options); /// @@ -48,7 +47,7 @@ public interface IDistributedCache /// /// Refreshes a value in the cache based on its key, resetting its sliding expiration timeout (if any). /// - /// A string identifying the requested entry. + /// A string identifying the requested calue. void Refresh(string key); /// diff --git a/src/Microsoft.Extensions.Caching.Abstractions/MemoryCacheEntryOptions.cs b/src/Microsoft.Extensions.Caching.Abstractions/MemoryCacheEntryOptions.cs index 95739632..93c04cde 100644 --- a/src/Microsoft.Extensions.Caching.Abstractions/MemoryCacheEntryOptions.cs +++ b/src/Microsoft.Extensions.Caching.Abstractions/MemoryCacheEntryOptions.cs @@ -8,7 +8,7 @@ namespace Microsoft.Extensions.Caching.Memory { /// - /// Represents the cache options applied to an entries of the instance. + /// Represents the cache options applied to an entry of the instance. /// public class MemoryCacheEntryOptions { From b46b2898a6f15b55207c04ec3467fd94451d0de1 Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Wed, 8 Aug 2018 11:42:50 -0700 Subject: [PATCH 3/3] Feedback --- .../DistributedCacheEntryOptions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.Extensions.Caching.Abstractions/DistributedCacheEntryOptions.cs b/src/Microsoft.Extensions.Caching.Abstractions/DistributedCacheEntryOptions.cs index d2fdb4d0..fafa4cc6 100644 --- a/src/Microsoft.Extensions.Caching.Abstractions/DistributedCacheEntryOptions.cs +++ b/src/Microsoft.Extensions.Caching.Abstractions/DistributedCacheEntryOptions.cs @@ -6,7 +6,7 @@ namespace Microsoft.Extensions.Caching.Distributed { /// - /// Represents the cache options applied to an entry of the instance. + /// Provides the cache options for an entry in . /// public class DistributedCacheEntryOptions {