src/DotNetCommon.Core/Cache/MemoryCacheEntryOptions.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

//using Microsoft.Extensions.Primitives;
//using System;
//using System.Collections.Generic;
//using System.Text;
//
//namespace DotNetCommon.Cache
//{
//    /// <summary>
//    /// Represents the cache options applied to an entry of the <see cref="IMemoryCache"/> instance.
//    /// </summary>
//    internal class MemoryCacheEntryOptions
//    {
//        private DateTimeOffset? _absoluteExpiration;
//        private TimeSpan? _absoluteExpirationRelativeToNow;
//        private TimeSpan? _slidingExpiration;
//        private long? _size;
//
//        /// <summary>
//        /// Gets or sets an absolute expiration date for the cache entry.
//        /// </summary>
//        public DateTimeOffset? AbsoluteExpiration
//        {
//            get
//            {
//                return _absoluteExpiration;
//            }
//            set
//            {
//                _absoluteExpiration = value;
//            }
//        }
//
//        /// <summary>
//        /// Gets or sets an absolute expiration time, relative to now.
//        /// </summary>
//        public TimeSpan? AbsoluteExpirationRelativeToNow
//        {
//            get
//            {
//                return _absoluteExpirationRelativeToNow;
//            }
//            set
//            {
//                if (value <= TimeSpan.Zero)
//                {
//                    throw new ArgumentOutOfRangeException(
//                        nameof(AbsoluteExpirationRelativeToNow),
//                        value,
//                        "The relative expiration value must be positive.");
//                }
//
//                _absoluteExpirationRelativeToNow = value;
//            }
//        }
//
//        /// <summary>
//        /// Gets or sets how long a cache entry can be inactive (e.g. not accessed) before it will be removed.
//        /// This will not extend the entry lifetime beyond the absolute expiration (if set).
//        /// </summary>
//        public TimeSpan? SlidingExpiration
后面还有 53 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。