Blog.Core/Blog.Core.Common/Attribute/CachingAttribute.cs
2019-01-17 18:21:59 +08:00

18 lines
490 B
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
namespace Blog.Core.Common
{
/// <summary>
/// 这个Attribute就是使用时候的验证把它添加到要缓存数据的方法中即可完成缓存的操作。
/// </summary>
[AttributeUsage(AttributeTargets.Method, Inherited = true)]
public class CachingAttribute : Attribute
{
/// <summary>
/// 缓存绝对过期时间(分钟)
/// </summary>
public int AbsoluteExpiration { get; set; } = 30;
}
}