mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-05-07 00:39:00 +08:00
docs(cache): 更新 WeakKeyCache 异常文档
- 为 GetOrAdd 方法添加 valueFactory 返回 null 时的异常说明 - 在 GlobalUsings 中添加 System.Runtime.CompilerServices 引用
This commit is contained in:
parent
45ab38519b
commit
3be34156cf
@ -7,3 +7,4 @@ global using System.Reflection;
|
|||||||
global using Microsoft.Extensions.DependencyInjection;
|
global using Microsoft.Extensions.DependencyInjection;
|
||||||
global using System.Diagnostics;
|
global using System.Diagnostics;
|
||||||
global using System.Collections.Concurrent;
|
global using System.Collections.Concurrent;
|
||||||
|
global using System.Runtime.CompilerServices;
|
||||||
|
|||||||
@ -27,6 +27,7 @@ internal sealed class WeakKeyCache<TKey, TValue>
|
|||||||
/// <returns>已存在或新创建的缓存值。</returns>
|
/// <returns>已存在或新创建的缓存值。</returns>
|
||||||
/// <exception cref="ArgumentNullException">
|
/// <exception cref="ArgumentNullException">
|
||||||
/// <paramref name="key" /> 或 <paramref name="valueFactory" /> 为 <see langword="null" />。
|
/// <paramref name="key" /> 或 <paramref name="valueFactory" /> 为 <see langword="null" />。
|
||||||
|
/// 或 <paramref name="valueFactory" /> 返回 <see langword="null" />。
|
||||||
/// </exception>
|
/// </exception>
|
||||||
public TValue GetOrAdd(TKey key, Func<TKey, TValue> valueFactory)
|
public TValue GetOrAdd(TKey key, Func<TKey, TValue> valueFactory)
|
||||||
{
|
{
|
||||||
@ -60,6 +61,7 @@ internal sealed class WeakKeyCache<TKey, TValue>
|
|||||||
/// <returns>已存在或新创建的缓存值。</returns>
|
/// <returns>已存在或新创建的缓存值。</returns>
|
||||||
/// <exception cref="ArgumentNullException">
|
/// <exception cref="ArgumentNullException">
|
||||||
/// <paramref name="key" /> 或 <paramref name="valueFactory" /> 为 <see langword="null" />。
|
/// <paramref name="key" /> 或 <paramref name="valueFactory" /> 为 <see langword="null" />。
|
||||||
|
/// 或 <paramref name="valueFactory" /> 返回 <see langword="null" />。
|
||||||
/// </exception>
|
/// </exception>
|
||||||
public TValue GetOrAdd<TState>(TKey key, TState state, Func<TKey, TState, TValue> valueFactory)
|
public TValue GetOrAdd<TState>(TKey key, TState state, Func<TKey, TState, TValue> valueFactory)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user