Skip to content

Commit bd806a9

Browse files
committed
Merge branch 'master' into merge/release/3.1-to-master
\n\nCommit migrated from dotnet/extensions@6b37bb0
2 parents 9b83c2e + c829946 commit bd806a9

File tree

39 files changed

+1115
-173
lines changed

39 files changed

+1115
-173
lines changed

src/Caching/Abstractions/ref/Microsoft.Extensions.Caching.Abstractions.netcoreapp.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,17 @@ public partial class MemoryCacheEntryOptions
119119
public MemoryCacheEntryOptions() { }
120120
public System.DateTimeOffset? AbsoluteExpiration { get { throw null; } set { } }
121121
public System.TimeSpan? AbsoluteExpirationRelativeToNow { get { throw null; } set { } }
122-
public System.Collections.Generic.IList<Microsoft.Extensions.Primitives.IChangeToken> ExpirationTokens { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
123-
public System.Collections.Generic.IList<Microsoft.Extensions.Caching.Memory.PostEvictionCallbackRegistration> PostEvictionCallbacks { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
124-
public Microsoft.Extensions.Caching.Memory.CacheItemPriority Priority { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
122+
public System.Collections.Generic.IList<Microsoft.Extensions.Primitives.IChangeToken> ExpirationTokens { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
123+
public System.Collections.Generic.IList<Microsoft.Extensions.Caching.Memory.PostEvictionCallbackRegistration> PostEvictionCallbacks { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
124+
public Microsoft.Extensions.Caching.Memory.CacheItemPriority Priority { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
125125
public long? Size { get { throw null; } set { } }
126126
public System.TimeSpan? SlidingExpiration { get { throw null; } set { } }
127127
}
128128
public partial class PostEvictionCallbackRegistration
129129
{
130130
public PostEvictionCallbackRegistration() { }
131-
public Microsoft.Extensions.Caching.Memory.PostEvictionDelegate EvictionCallback { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
132-
public object State { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
131+
public Microsoft.Extensions.Caching.Memory.PostEvictionDelegate EvictionCallback { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
132+
public object State { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
133133
}
134134
public delegate void PostEvictionDelegate(object key, object value, Microsoft.Extensions.Caching.Memory.EvictionReason reason, object state);
135135
}

src/Caching/Abstractions/ref/Microsoft.Extensions.Caching.Abstractions.netstandard2.0.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,17 @@ public partial class MemoryCacheEntryOptions
119119
public MemoryCacheEntryOptions() { }
120120
public System.DateTimeOffset? AbsoluteExpiration { get { throw null; } set { } }
121121
public System.TimeSpan? AbsoluteExpirationRelativeToNow { get { throw null; } set { } }
122-
public System.Collections.Generic.IList<Microsoft.Extensions.Primitives.IChangeToken> ExpirationTokens { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
123-
public System.Collections.Generic.IList<Microsoft.Extensions.Caching.Memory.PostEvictionCallbackRegistration> PostEvictionCallbacks { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
124-
public Microsoft.Extensions.Caching.Memory.CacheItemPriority Priority { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
122+
public System.Collections.Generic.IList<Microsoft.Extensions.Primitives.IChangeToken> ExpirationTokens { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
123+
public System.Collections.Generic.IList<Microsoft.Extensions.Caching.Memory.PostEvictionCallbackRegistration> PostEvictionCallbacks { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
124+
public Microsoft.Extensions.Caching.Memory.CacheItemPriority Priority { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
125125
public long? Size { get { throw null; } set { } }
126126
public System.TimeSpan? SlidingExpiration { get { throw null; } set { } }
127127
}
128128
public partial class PostEvictionCallbackRegistration
129129
{
130130
public PostEvictionCallbackRegistration() { }
131-
public Microsoft.Extensions.Caching.Memory.PostEvictionDelegate EvictionCallback { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
132-
public object State { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
131+
public Microsoft.Extensions.Caching.Memory.PostEvictionDelegate EvictionCallback { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
132+
public object State { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
133133
}
134134
public delegate void PostEvictionDelegate(object key, object value, Microsoft.Extensions.Caching.Memory.EvictionReason reason, object state);
135135
}

src/Caching/Abstractions/src/DistributedCacheExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,12 @@ public static string GetString(this IDistributedCache cache, string key)
152152
/// <returns>A task that gets the string value from the stored cache key.</returns>
153153
public static async Task<string> GetStringAsync(this IDistributedCache cache, string key, CancellationToken token = default(CancellationToken))
154154
{
155-
var data = await cache.GetAsync(key, token);
155+
var data = await cache.GetAsync(key, token).ConfigureAwait(false);
156156
if (data == null)
157157
{
158158
return null;
159159
}
160160
return Encoding.UTF8.GetString(data, 0, data.Length);
161161
}
162162
}
163-
}
163+
}

src/Caching/Abstractions/src/MemoryCacheExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public static async Task<TItem> GetOrCreateAsync<TItem>(this IMemoryCache cache,
116116
if (!cache.TryGetValue(key, out object result))
117117
{
118118
var entry = cache.CreateEntry(key);
119-
result = await factory(entry);
119+
result = await factory(entry).ConfigureAwait(false);
120120
entry.SetValue(result);
121121
// need to manually call dispose instead of having a using
122122
// in case the factory passed in throws, in which case we

src/Caching/Abstractions/src/Microsoft.Extensions.Caching.Abstractions.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Microsoft.Extensions.Caching.Memory.IMemoryCache</Description>
1616

1717
<ItemGroup>
1818
<Reference Include="Microsoft.Extensions.Primitives" />
19+
<Reference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" PrivateAssets="All" />
1920
</ItemGroup>
2021

2122
</Project>

0 commit comments

Comments
 (0)