Skip to content

Commit 75ecb1a

Browse files
ViktorHofertarekghadityamandaleekacarlossanlop
authored
Create docs transport package and turn on extensions source of truth (#89312)
* Create docs ref+xml transport package Contributes to #996. Add a nuget package that contains all the reference assemblies and source-of-truth API docs XML files for the current release. * Turn on source of truth for Microsoft.Extensions.* Make the source of truth for API docs for the Microsoft.Extensions.* libraries dotnet/runtime instead of the intellisense package. Disable the few projects that aren't yet documented. Same for libraries that are already effectively source-of-truth in runtime but which aren't documented. * Add missing triple slash docs in Primitives * Fill in missing keyed DI doc comments. * Add memory cache triple slash docs * Add more missing docs * Add more missing docs * More missing docs * More docs * More * Add Microsoft.Extensions.Logging.Console docs * Microsoft.Extensions.Hosting docs * Exclude Microsoft.Bcl.* * Update src/libraries/Microsoft.Internal.Runtime.DotNetApiDocs.Transport/src/Microsoft.Internal.Runtime.DotNetApiDocs.Transport.proj Co-authored-by: Carlos Sánchez López <[email protected]> --------- Co-authored-by: Tarek Mahmoud Sayed <[email protected]> Co-authored-by: Aditya Mandaleeka <[email protected]> Co-authored-by: Carlos Sánchez López <[email protected]>
1 parent fa9ad22 commit 75ecb1a

File tree

46 files changed

+608
-25
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+608
-25
lines changed

eng/intellisense.targets

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,46 @@
1-
<Project InitialTargets="VerifyAssemblySupportsDocsXmlGeneration">
1+
<Project>
22

33
<PropertyGroup>
4-
<UseIntellisensePackageDocXmlFile Condition="'$(UseIntellisensePackageDocXmlFile)' == ''">true</UseIntellisensePackageDocXmlFile>
4+
<UseCompilerGeneratedDocXmlFile Condition="'$(UseCompilerGeneratedDocXmlFile)' == '' and $(MSBuildProjectName.StartsWith('Microsoft.Extensions.'))">true</UseCompilerGeneratedDocXmlFile>
55
</PropertyGroup>
66

7-
<Target Name="VerifyAssemblySupportsDocsXmlGeneration"
8-
Condition="'$(UseIntellisensePackageDocXmlFile)' != 'true'">
9-
<Error Text="The 'UseIntellisensePackageDocXmlFile' property is not supported for partial facade assemblies: $(AssemblyName)"
10-
Condition="'$(IsPartialFacadeAssembly)' == 'true'" />
11-
<Error Text="The 'UseIntellisensePackageDocXmlFile' property is not supported for assemblies that throw PlatformNotSupportedException: $(AssemblyName)"
12-
Condition="'$(GeneratePlatformNotSupportedAssemblyMessage)' != ''" />
13-
</Target>
14-
15-
<PropertyGroup Condition="'$(UseIntellisensePackageDocXmlFile)' == 'true'">
7+
<PropertyGroup Condition="'$(UseCompilerGeneratedDocXmlFile)' != 'true'">
168
<IntellisensePackageXmlRootFolder>$([MSBuild]::NormalizeDirectory('$(NuGetPackageRoot)', 'microsoft.private.intellisense', '$(MicrosoftPrivateIntellisenseVersion)', 'IntellisenseFiles'))</IntellisensePackageXmlRootFolder>
179
<IntellisensePackageXmlFilePathFromNetFolder>$([MSBuild]::NormalizePath('$(IntellisensePackageXmlRootFolder)', 'net', '1033', '$(AssemblyName).xml'))</IntellisensePackageXmlFilePathFromNetFolder>
1810
<IntellisensePackageXmlFilePathFromDotNetPlatExtFolder>$([MSBuild]::NormalizePath('$(IntellisensePackageXmlRootFolder)', 'dotnet-plat-ext', '1033', '$(AssemblyName).xml'))</IntellisensePackageXmlFilePathFromDotNetPlatExtFolder>
1911
<IntellisensePackageXmlFilePath Condition="'$(IntellisensePackageXmlFilePath)' == '' and Exists($(IntellisensePackageXmlFilePathFromNetFolder))">$(IntellisensePackageXmlFilePathFromNetFolder)</IntellisensePackageXmlFilePath>
2012
<IntellisensePackageXmlFilePath Condition="'$(IntellisensePackageXmlFilePath)' == '' and Exists($(IntellisensePackageXmlFilePathFromDotNetPlatExtFolder))">$(IntellisensePackageXmlFilePathFromDotNetPlatExtFolder)</IntellisensePackageXmlFilePath>
13+
14+
<!-- If the intellisense package doesn't provide an XML, use the compiler generated one instead. -->
15+
<UseCompilerGeneratedDocXmlFile Condition="'$(IntellisensePackageXmlFilePath)' == '' and '$(GenerateDocumentationFile)' == 'true'">true</UseCompilerGeneratedDocXmlFile>
16+
2117
<!-- Suppress "CS1591 - Missing XML comment for publicly visible type or member" compiler errors if
2218
- the intellisense package xml file is used or
2319
- the assembly is private (i.e. System.Private.Uri) or
2420
- the assembly is a PNSE assembly. -->
25-
<NoWarn Condition="'$(IntellisensePackageXmlFilePath)' != '' or
21+
<NoWarn Condition="'$(UseCompilerGeneratedDocXmlFile)' != 'true' or
2622
'$(IsPrivateAssembly)' == 'true' or
2723
'$(GeneratePlatformNotSupportedAssemblyMessage)' != ''">$(NoWarn);1591</NoWarn>
2824
</PropertyGroup>
2925

26+
<!-- Flow these properties to consuming projects for Microsoft.Internal.Runtime.DotNetApiDocs.Transport.proj to only
27+
include the source of truth compiler generated documentation files. -->
28+
<ItemDefinitionGroup>
29+
<TargetPathWithTargetPlatformMoniker>
30+
<UseCompilerGeneratedDocXmlFile>$(UseCompilerGeneratedDocXmlFile)</UseCompilerGeneratedDocXmlFile>
31+
<IsPartialFacadeAssembly>$(IsPartialFacadeAssembly)</IsPartialFacadeAssembly>
32+
<IsPlatformNotSupportedAssembly Condition="'$(GeneratePlatformNotSupportedAssemblyMessage)' != ''">true</IsPlatformNotSupportedAssembly>
33+
</TargetPathWithTargetPlatformMoniker>
34+
</ItemDefinitionGroup>
35+
3036
<ItemGroup>
3137
<PackageDownload Include="Microsoft.Private.Intellisense" Version="[$(MicrosoftPrivateIntellisenseVersion)]" />
3238
</ItemGroup>
3339

3440
<!-- Replace the compiler generated xml file in the obj folder with the one that comes from the intellisense package. -->
3541
<Target Name="ChangeDocumentationFileForPackaging"
3642
BeforeTargets="CopyFilesToOutputDirectory;DocumentationProjectOutputGroup"
37-
Condition="'$(IntellisensePackageXmlFilePath)' != ''">
43+
Condition="'$(UseCompilerGeneratedDocXmlFile)' != 'true' and '$(IntellisensePackageXmlFilePath)' != ''">
3844
<ItemGroup>
3945
<DocFileItem Remove="@(DocFileItem)" />
4046
<DocFileItem Include="$(IntellisensePackageXmlFilePath)" />

src/libraries/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<DisableArcadeTestFramework>true</DisableArcadeTestFramework>
44
<!-- Enabling this rule will cause build failures on undocumented public APIs.
5-
We cannot add it in eng/Versions.props because src/coreclr does not have access to UseIntellisensePackageDocXmlFile, which ensures
5+
We cannot add it in eng/Versions.props because src/coreclr does not have access to UseCompilerGeneratedDocXmlFile, which ensures
66
we only enable it in specific projects. so to avoid duplicating this property in coreclr, we can first scope it to src/libraries.
77
This property needs to be declared before the ..\..\Directory.Build.props import. -->
88
<SkipArcadeNoWarnCS1591>true</SkipArcadeNoWarnCS1591>

src/libraries/Microsoft.Bcl.AsyncInterfaces/src/Microsoft.Bcl.AsyncInterfaces.csproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2+
23
<PropertyGroup>
34
<TargetFrameworks>netstandard2.0;$(NetFrameworkMinimum);netstandard2.1</TargetFrameworks>
45
<IsPackable>true</IsPackable>
@@ -9,10 +10,14 @@ Commonly Used Types:
910
System.IAsyncDisposable
1011
System.Collections.Generic.IAsyncEnumerable
1112
System.Collections.Generic.IAsyncEnumerator</PackageDescription>
13+
<!-- This library uses IsPartialFacadeAssembly for which the compiler doesn't produce any XML documentation. -->
14+
<UseCompilerGeneratedDocXmlFile>false</UseCompilerGeneratedDocXmlFile>
1215
</PropertyGroup>
16+
1317
<PropertyGroup>
1418
<IsPartialFacadeAssembly Condition="'$(TargetFramework)' == 'netstandard2.1'">true</IsPartialFacadeAssembly>
1519
</PropertyGroup>
20+
1621
<ItemGroup Condition="'$(IsPartialFacadeAssembly)' != 'true'">
1722
<Compile Include="System\Threading\Tasks\Sources\ManualResetValueTaskSourceCore.cs" />
1823
<Compile Include="System\Runtime\CompilerServices\AsyncIteratorMethodBuilder.cs" />
@@ -40,8 +45,10 @@ System.Collections.Generic.IAsyncEnumerator</PackageDescription>
4045
<Compile Include="$(CoreLibSharedDir)\System\Runtime\CompilerServices\EnumeratorCancellationAttribute.cs">
4146
<Link>System.Private.CoreLib\System\Runtime\CompilerServices\EnumeratorCancellationAttribute.cs</Link>
4247
</Compile>
48+
4349
</ItemGroup>
4450
<ItemGroup Condition="'$(IsPartialFacadeAssembly)' != 'true'">
4551
<PackageReference Include="System.Threading.Tasks.Extensions" Version="$(SystemThreadingTasksExtensionsVersion)" />
4652
</ItemGroup>
53+
4754
</Project>

src/libraries/Microsoft.Bcl.Cryptography/src/Microsoft.Bcl.Cryptography.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2+
23
<PropertyGroup>
34
<TargetFrameworks>$(NetCoreAppCurrent);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
45
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@@ -11,6 +12,8 @@
1112

1213
Commonly Used Types:
1314
System.Security.Cryptography.SP800108HmacCounterKdf</PackageDescription>
15+
<!-- This library uses IsPartialFacadeAssembly for which the compiler doesn't produce any XML documentation. -->
16+
<UseCompilerGeneratedDocXmlFile>false</UseCompilerGeneratedDocXmlFile>
1417
</PropertyGroup>
1518

1619
<PropertyGroup>
@@ -72,4 +75,5 @@ System.Security.Cryptography.SP800108HmacCounterKdf</PackageDescription>
7275
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'">
7376
<PackageReference Include="System.Memory" Version="$(SystemMemoryVersion)" />
7477
</ItemGroup>
78+
7579
</Project>

src/libraries/Microsoft.Bcl.TimeProvider/src/Microsoft.Bcl.TimeProvider.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
Commonly Used Types:
1313
System.TimeProvider
1414
System.ITimer</PackageDescription>
15+
<!-- This library uses IsPartialFacadeAssembly for which the compiler doesn't produce any XML documentation. -->
16+
<UseCompilerGeneratedDocXmlFile>false</UseCompilerGeneratedDocXmlFile>
1517
</PropertyGroup>
1618

1719
<PropertyGroup>

src/libraries/Microsoft.Extensions.Caching.Abstractions/src/CacheEntryExtensions.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
namespace Microsoft.Extensions.Caching.Memory
99
{
10+
/// <summary>
11+
/// Provide extensions methods for <see cref="ICacheEntry"/> operations.
12+
/// </summary>
1013
public static class CacheEntryExtensions
1114
{
1215
/// <summary>

src/libraries/Microsoft.Extensions.Caching.Abstractions/src/CacheItemPriority.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,24 @@ namespace Microsoft.Extensions.Caching.Memory
99
/// </summary>
1010
public enum CacheItemPriority
1111
{
12+
/// <summary>
13+
/// The cache entry should be removed as soon as possible during memory pressure triggered cleanup.
14+
/// </summary>
1215
Low,
16+
17+
/// <summary>
18+
/// The cache entry should be removed if there is no other low priority cache entries during memory pressure triggered cleanup.
19+
/// </summary>
1320
Normal,
21+
22+
/// <summary>
23+
/// The cache entry should be removed only when there is no other low or normal priority cache entries during memory pressure triggered cleanup.
24+
/// </summary>
1425
High,
26+
27+
/// <summary>
28+
/// The cache entry should never be removed during memory pressure triggered cleanup.
29+
/// </summary>
1530
NeverRemove,
1631
}
1732
}

src/libraries/Microsoft.Extensions.Caching.Abstractions/src/DistributedCacheEntryExtensions.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55

66
namespace Microsoft.Extensions.Caching.Distributed
77
{
8+
/// <summary>
9+
/// Extension methods for <see cref="DistributedCacheEntryOptions"/> operations.
10+
/// </summary>
811
public static class DistributedCacheEntryExtensions
912
{
1013
/// <summary>

src/libraries/Microsoft.Extensions.Caching.Abstractions/src/EvictionReason.cs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,38 @@
33

44
namespace Microsoft.Extensions.Caching.Memory
55
{
6+
/// <summary>
7+
/// Specify the reasons why an entry was evicted from the cache.
8+
/// </summary>
69
public enum EvictionReason
710
{
11+
/// <summary>
12+
/// The item was not removed from the cache.
13+
/// </summary>
814
None,
915

1016
/// <summary>
11-
/// Manually
17+
/// The item was removed from the cache manually.
1218
/// </summary>
1319
Removed,
1420

1521
/// <summary>
16-
/// Overwritten
22+
/// The item was removed from the cache because it was overwritten.
1723
/// </summary>
1824
Replaced,
1925

2026
/// <summary>
21-
/// Timed out
27+
/// The item was removed from the cache because it timed out.
2228
/// </summary>
2329
Expired,
2430

2531
/// <summary>
26-
/// Event
32+
/// The item was removed from the cache because its token expired.
2733
/// </summary>
2834
TokenExpired,
2935

3036
/// <summary>
31-
/// Overflow
37+
/// The item was removed from the cache because it exceeded its capacity.
3238
/// </summary>
3339
Capacity,
3440
}

src/libraries/Microsoft.Extensions.Caching.Abstractions/src/MemoryCacheEntryExtensions.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
namespace Microsoft.Extensions.Caching.Memory
88
{
9+
/// <summary>
10+
/// Provide extensions methods for <see cref="MemoryCacheEntryOptions"/> operations.
11+
/// </summary>
912
public static class MemoryCacheEntryExtensions
1013
{
1114
/// <summary>

src/libraries/Microsoft.Extensions.Caching.Abstractions/src/MemoryCacheExtensions.cs

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,43 @@
77

88
namespace Microsoft.Extensions.Caching.Memory
99
{
10+
/// <summary>
11+
/// Provide extensions methods for <see cref="IMemoryCache"/> operations.
12+
/// </summary>
1013
public static class CacheExtensions
1114
{
15+
/// <summary>
16+
/// Gets the value associated with this key if present.
17+
/// </summary>
18+
/// <param name="cache">The <see cref="IMemoryCache"/> instance this method extends.</param>
19+
/// <param name="key">The key of the value to get.</param>
20+
/// <returns>The value associated with this key, or <c>null</c> if the key is not present.</returns>
1221
public static object? Get(this IMemoryCache cache, object key)
1322
{
1423
cache.TryGetValue(key, out object? value);
1524
return value;
1625
}
1726

27+
/// <summary>
28+
/// Gets the value associated with this key if present.
29+
/// </summary>
30+
/// <typeparam name="TItem">The type of the object to get.</typeparam>
31+
/// <param name="cache">The <see cref="IMemoryCache"/> instance this method extends.</param>
32+
/// <param name="key">The key of the value to get.</param>
33+
/// <returns>The value associated with this key, or <c>default(TItem)</c> if the key is not present.</returns>
1834
public static TItem? Get<TItem>(this IMemoryCache cache, object key)
1935
{
2036
return (TItem?)(cache.Get(key) ?? default(TItem));
2137
}
2238

39+
/// <summary>
40+
/// Try to get the value associated with the given key.
41+
/// </summary>
42+
/// <typeparam name="TItem">The type of the object to get.</typeparam>
43+
/// <param name="cache">The <see cref="IMemoryCache"/> instance this method extends.</param>
44+
/// <param name="key">The key of the value to get.</param>
45+
/// <param name="value">The value associated with the given key.</param>
46+
/// <returns><c>true</c> if the key was found. <c>false</c> otherwise.</returns>
2347
public static bool TryGetValue<TItem>(this IMemoryCache cache, object key, out TItem? value)
2448
{
2549
if (cache.TryGetValue(key, out object? result))
@@ -41,6 +65,14 @@ public static bool TryGetValue<TItem>(this IMemoryCache cache, object key, out T
4165
return false;
4266
}
4367

68+
/// <summary>
69+
/// Associate a value with a key in the <see cref="IMemoryCache"/>.
70+
/// </summary>
71+
/// <typeparam name="TItem">The type of the object to set.</typeparam>
72+
/// <param name="cache">The <see cref="IMemoryCache"/> instance this method extends.</param>
73+
/// <param name="key">The key of the entry to add.</param>
74+
/// <param name="value">The value to associate with the key.</param>
75+
/// <returns>The value that was set.</returns>
4476
public static TItem Set<TItem>(this IMemoryCache cache, object key, TItem value)
4577
{
4678
using ICacheEntry entry = cache.CreateEntry(key);
@@ -49,6 +81,15 @@ public static TItem Set<TItem>(this IMemoryCache cache, object key, TItem value)
4981
return value;
5082
}
5183

84+
/// <summary>
85+
/// Sets a cache entry with the given key and value that will expire in the given duration.
86+
/// </summary>
87+
/// <typeparam name="TItem">The type of the object to set.</typeparam>
88+
/// <param name="cache">The <see cref="IMemoryCache"/> instance this method extends.</param>
89+
/// <param name="key">The key of the entry to add.</param>
90+
/// <param name="value">The value to associate with the key.</param>
91+
/// <param name="absoluteExpiration">The point in time at which the cache entry will expire.</param>
92+
/// <returns>The value that was set.</returns>
5293
public static TItem Set<TItem>(this IMemoryCache cache, object key, TItem value, DateTimeOffset absoluteExpiration)
5394
{
5495
using ICacheEntry entry = cache.CreateEntry(key);
@@ -58,6 +99,15 @@ public static TItem Set<TItem>(this IMemoryCache cache, object key, TItem value,
5899
return value;
59100
}
60101

102+
/// <summary>
103+
/// Sets a cache entry with the given key and value that will expire in the given duration from now.
104+
/// </summary>
105+
/// <typeparam name="TItem">The type of the object to set.</typeparam>
106+
/// <param name="cache">The <see cref="IMemoryCache"/> instance this method extends.</param>
107+
/// <param name="key">The key of the entry to add.</param>
108+
/// <param name="value">The value to associate with the key.</param>
109+
/// <param name="absoluteExpirationRelativeToNow">The duration from now after which the cache entry will expire.</param>
110+
/// <returns>The value that was set.</returns>
61111
public static TItem Set<TItem>(this IMemoryCache cache, object key, TItem value, TimeSpan absoluteExpirationRelativeToNow)
62112
{
63113
using ICacheEntry entry = cache.CreateEntry(key);
@@ -67,6 +117,15 @@ public static TItem Set<TItem>(this IMemoryCache cache, object key, TItem value,
67117
return value;
68118
}
69119

120+
/// <summary>
121+
/// Sets a cache entry with the given key and value that will expire when <see cref="IChangeToken"/> expires.
122+
/// </summary>
123+
/// <typeparam name="TItem">The type of the object to set.</typeparam>
124+
/// <param name="cache">The <see cref="IMemoryCache"/> instance this method extends.</param>
125+
/// <param name="key">The key of the entry to add.</param>
126+
/// <param name="value">The value to associate with the key.</param>
127+
/// <param name="expirationToken">The <see cref="IChangeToken"/> that causes the cache entry to expire.</param>
128+
/// <returns>The value that was set.</returns>
70129
public static TItem Set<TItem>(this IMemoryCache cache, object key, TItem value, IChangeToken expirationToken)
71130
{
72131
using ICacheEntry entry = cache.CreateEntry(key);
@@ -76,6 +135,15 @@ public static TItem Set<TItem>(this IMemoryCache cache, object key, TItem value,
76135
return value;
77136
}
78137

138+
/// <summary>
139+
/// Sets a cache entry with the given key and value and apply the values of an existing <see cref="MemoryCacheEntryOptions"/> to the created entry.
140+
/// </summary>
141+
/// <typeparam name="TItem">The type of the object to set.</typeparam>
142+
/// <param name="cache">The <see cref="IMemoryCache"/> instance this method extends.</param>
143+
/// <param name="key">The key of the entry to add.</param>
144+
/// <param name="value">The value to associate with the key.</param>
145+
/// <param name="options">The existing <see cref="MemoryCacheEntryOptions"/> instance to apply to the new entry.</param>
146+
/// <returns>The value that was set.</returns>
79147
public static TItem Set<TItem>(this IMemoryCache cache, object key, TItem value, MemoryCacheEntryOptions? options)
80148
{
81149
using ICacheEntry entry = cache.CreateEntry(key);
@@ -89,6 +157,14 @@ public static TItem Set<TItem>(this IMemoryCache cache, object key, TItem value,
89157
return value;
90158
}
91159

160+
/// <summary>
161+
/// Gets the value associated with this key if it exists, or generates a new entry using the provided key and a value from the given factory if the key is not found.
162+
/// </summary>
163+
/// <typeparam name="TItem">The type of the object to get.</typeparam>
164+
/// <param name="cache">The <see cref="IMemoryCache"/> instance this method extends.</param>
165+
/// <param name="key">The key of the entry to look for or create.</param>
166+
/// <param name="factory">The factory that creates the value associated with this key if the key does not exist in the cache.</param>
167+
/// <returns>The value associated with this key.</returns>
92168
public static TItem? GetOrCreate<TItem>(this IMemoryCache cache, object key, Func<ICacheEntry, TItem> factory)
93169
{
94170
if (!cache.TryGetValue(key, out object? result))
@@ -102,6 +178,14 @@ public static TItem Set<TItem>(this IMemoryCache cache, object key, TItem value,
102178
return (TItem?)result;
103179
}
104180

181+
/// <summary>
182+
/// Asynchronously gets the value associated with this key if it exists, or generates a new entry using the provided key and a value from the given factory if the key is not found.
183+
/// </summary>
184+
/// <typeparam name="TItem">The type of the object to get.</typeparam>
185+
/// <param name="cache">The <see cref="IMemoryCache"/> instance this method extends.</param>
186+
/// <param name="key">The key of the entry to look for or create.</param>
187+
/// <param name="factory">The factory task that creates the value associated with this key if the key does not exist in the cache.</param>
188+
/// <returns>The task object representing the asynchronous operation.</returns>
105189
public static async Task<TItem?> GetOrCreateAsync<TItem>(this IMemoryCache cache, object key, Func<ICacheEntry, Task<TItem>> factory)
106190
{
107191
if (!cache.TryGetValue(key, out object? result))

0 commit comments

Comments
 (0)