Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Adding documentation comments #416

Merged
merged 3 commits into from
Aug 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

namespace Microsoft.Extensions.Caching.Distributed
{
/// <summary>
/// Provides the cache options for an entry in <see cref="IDistributedCache"/>.
/// </summary>
public class DistributedCacheEntryOptions
{
private DateTimeOffset? _absoluteExpiration;
Expand Down
48 changes: 48 additions & 0 deletions src/Microsoft.Extensions.Caching.Abstractions/IDistributedCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,70 @@

namespace Microsoft.Extensions.Caching.Distributed
{
/// <summary>
/// Represents a distributed cache of serialized values.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Contract for a distributed cache of serialized values.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, consistency with IMemoryCache

/// </summary>
public interface IDistributedCache
{
/// <summary>
/// Gets a value with the given key.
/// </summary>
/// <param name="key">A string identifying the requested value.</param>
/// <returns>The located value or null.</returns>
byte[] Get(string key);

/// <summary>
/// Gets a value with the given key.
/// </summary>
/// <param name="key">A string identifying the requested value.</param>
/// <param name="token">Optional. The <see cref="CancellationToken"/> used to propagate notifications that the operation should be canceled.</param>
/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the located value or null.</returns>
Task<byte[]> GetAsync(string key, CancellationToken token = default(CancellationToken));

/// <summary>
/// Sets a value with the given key.
/// </summary>
/// <param name="key">A string identifying the requested value.</param>
/// <param name="value">The value to set in the cache.</param>
/// <param name="options">The cache options for the value.</param>
void Set(string key, byte[] value, DistributedCacheEntryOptions options);

/// <summary>
/// Sets the value with the given key.
/// </summary>
/// <param name="key">A string identifying the requested value.</param>
/// <param name="value">The value to set in the cache.</param>
/// <param name="options">The cache options for the value.</param>
/// <param name="token">Optional. The <see cref="CancellationToken"/> used to propagate notifications that the operation should be canceled.</param>
/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns>
Task SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token = default(CancellationToken));

/// <summary>
/// Refreshes a value in the cache based on its key, resetting its sliding expiration timeout (if any).
/// </summary>
/// <param name="key">A string identifying the requested calue.</param>
void Refresh(string key);

/// <summary>
/// Refreshes a value in the cache based on its key, resetting its sliding expiration timeout (if any).
/// </summary>
/// <param name="key">A string identifying the requested value.</param>
/// <param name="token">Optional. The <see cref="CancellationToken"/> used to propagate notifications that the operation should be canceled.</param>
/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns>
Task RefreshAsync(string key, CancellationToken token = default(CancellationToken));

/// <summary>
/// Removes the value with the given key.
/// </summary>
/// <param name="key">A string identifying the requested value.</param>
void Remove(string key);

/// <summary>
/// Removes the value with the given key.
/// </summary>
/// <param name="key">A string identifying the requested value.</param>
/// <param name="token">Optional. The <see cref="CancellationToken"/> used to propagate notifications that the operation should be canceled.</param>
/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns>
Task RemoveAsync(string key, CancellationToken token = default(CancellationToken));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

namespace Microsoft.Extensions.Caching.Memory
{
/// <summary>
/// Represents the cache options applied to an entry of the <see cref="IMemoryCache"/> instance.
/// </summary>
public class MemoryCacheEntryOptions
{
private DateTimeOffset? _absoluteExpiration;
Expand Down