src/DotNetCommon.Core/Cache/CacheEntryExtensions.cs
(开头部分) 8KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
//using Microsoft.Extensions.Primitives;
//using System;
//using System.Collections.Generic;
//using System.Text;
//
//namespace DotNetCommon.Cache
//{
// internal static class CacheEntryExtensions
// {
// /// <summary>
// /// Sets the priority for keeping the cache entry in the cache during a memory pressure tokened cleanup.
// /// </summary>
// /// <param name="entry">The entry to set the priority for.</param>
// /// <param name="priority">The <see cref="CacheItemPriority"/> to set on the entry.</param>
// /// <returns>The <see cref="ICacheEntry"/> for chaining.</returns>
// public static ICacheEntry SetPriority(
// this ICacheEntry entry,
// CacheItemPriority priority)
// {
// entry.Priority = priority;
// return entry;
// }
//
// /// <summary>
// /// Expire the cache entry if the given <see cref="IChangeToken"/> expires.
// /// </summary>
// /// <param name="entry">The <see cref="ICacheEntry"/>.</param>
// /// <param name="expirationToken">The <see cref="IChangeToken"/> that causes the cache entry to expire.</param>
// /// <returns>The <see cref="ICacheEntry"/> for chaining.</returns>
// public static ICacheEntry AddExpirationToken(
// this ICacheEntry entry,
// IChangeToken expirationToken)
// {
// if (expirationToken == null)
// {
// throw new ArgumentNullException(nameof(expirationToken));
// }
//
// entry.ExpirationTokens.Add(expirationToken);
// return entry;
// }
//
// /// <summary>
// /// Sets an absolute expiration time, relative to now.
// /// </summary>
// /// <param name="entry">The <see cref="ICacheEntry"/>.</param>
// /// <param name="relative">The <see cref="TimeSpan"/> representing the expiration time relative to now.</param>
// /// <returns>The <see cref="ICacheEntry"/> for chaining.</returns>
// public static ICacheEntry SetAbsoluteExpiration(
// this ICacheEntry entry,
// TimeSpan relative)
// {
// entry.AbsoluteExpirationRelativeToNow = relative;
// return entry;
// }
//
// /// <summary>
// /// Sets an absolute expiration date for the cache entry.
// /// </summary>
// /// <param name="entry">The <see cref="ICacheEntry"/>.</param>
后面还有 134 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
