automated: merge branch release/2.2

This commit is contained in:
Nate McMaster 2018-09-28 17:27:27 -07:00
Родитель f6d0f012e6 89c7b9512f
Коммит a91cf87e60
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: A778D9601BD78810
5 изменённых файлов: 58 добавлений и 7 удалений

Просмотреть файл

@ -14,9 +14,6 @@
<RepositoryRoot>$(MSBuildThisFileDirectory)</RepositoryRoot>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)build\Key.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<AssemblySigningCertName>Microsoft</AssemblySigningCertName>
<PackageSigningCertName>MicrosoftNuGet</PackageSigningCertName>
<PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

8
run.sh
Просмотреть файл

@ -220,7 +220,7 @@ if [ -f "$config_file" ]; then
config_channel="$(jq -r 'select(.channel!=null) | .channel' "$config_file")"
config_tools_source="$(jq -r 'select(.toolsSource!=null) | .toolsSource' "$config_file")"
else
_error "$config_file contains invalid JSON."
__error "$config_file contains invalid JSON."
exit 1
fi
elif __machine_has python ; then
@ -228,7 +228,7 @@ if [ -f "$config_file" ]; then
config_channel="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['channel'] if 'channel' in obj else '')")"
config_tools_source="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['toolsSource'] if 'toolsSource' in obj else '')")"
else
_error "$config_file contains invalid JSON."
__error "$config_file contains invalid JSON."
exit 1
fi
elif __machine_has python3 ; then
@ -236,11 +236,11 @@ if [ -f "$config_file" ]; then
config_channel="$(python3 -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['channel'] if 'channel' in obj else '')")"
config_tools_source="$(python3 -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['toolsSource'] if 'toolsSource' in obj else '')")"
else
_error "$config_file contains invalid JSON."
__error "$config_file contains invalid JSON."
exit 1
fi
else
_error 'Missing required command: jq or python. Could not parse the JSON file.'
__error 'Missing required command: jq or python. Could not parse the JSON file.'
exit 1
fi

Просмотреть файл

@ -5,6 +5,9 @@ using System;
namespace Microsoft.Extensions.Caching.Distributed
{
/// <summary>
/// Provides the cache options for an entry in <see cref="IDistributedCache"/>.
/// </summary>
public class DistributedCacheEntryOptions
{
private DateTimeOffset? _absoluteExpiration;

Просмотреть файл

@ -6,22 +6,70 @@ using System.Threading.Tasks;
namespace Microsoft.Extensions.Caching.Distributed
{
/// <summary>
/// Represents a distributed cache of serialized values.
/// </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));
}
}

Просмотреть файл

@ -7,6 +7,9 @@ using Microsoft.Extensions.Primitives;
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;