YD_YiLu.Api/YD_YiLu.Commons/Attribute/CachingAttribute.cs

17 lines
468 B
C#
Raw Normal View History

2026-03-04 09:05:31 +08:00
using System;
2026-03-27 10:53:02 +08:00
namespace YD_YiLu.Commons
2026-03-04 09:05:31 +08:00
{
/// <summary>
/// 这个Attribute就是使用时候的验证,把它添加到要缓存数据的方法中,即可完成缓存的操作。
/// </summary>
[AttributeUsage(AttributeTargets.All)]
public class CachingAttribute : Attribute
{
/// <summary>
/// 缓存绝对过期时间(分钟)
/// </summary>
public int AbsoluteExpiration { get; set; } = 30;
}
}