mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-08-06 16:22:28 +08:00
wip: 🧠 初步的框架
This commit is contained in:
29
src/backend/NetAdmin.Cache/CacheBase.cs
Normal file
29
src/backend/NetAdmin.Cache/CacheBase.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using NetAdmin.Application.Services;
|
||||
|
||||
namespace NetAdmin.Cache;
|
||||
|
||||
/// <summary>
|
||||
/// 缓存基类
|
||||
/// </summary>
|
||||
public abstract class CacheBase<TCacheContainer, TService> : ICache<TCacheContainer, TService>
|
||||
where TService : IService
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CacheBase{TCacheLoad, TService}" /> class.
|
||||
/// </summary>
|
||||
protected CacheBase(TCacheContainer cache, TService service)
|
||||
{
|
||||
Cache = cache;
|
||||
Service = service;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 缓存对象
|
||||
/// </summary>
|
||||
public TCacheContainer Cache { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 关联的服务
|
||||
/// </summary>
|
||||
public TService Service { get; }
|
||||
}
|
Reference in New Issue
Block a user