28 lines
730 B
C#
28 lines
730 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace IRaCIS.Core.Application.Helper
|
|
{
|
|
|
|
public static class CacheKeys
|
|
{
|
|
public static string Trial(string trialIdStr) => $"TrialId:{trialIdStr}";
|
|
|
|
|
|
// 你可以为其他实体和模块定义更多的键
|
|
}
|
|
|
|
public static class CacheHelper
|
|
{
|
|
public static async Task<string?> GetTrialStatusAsync(Guid trialId, IRepository<Trial> _trialRepository)
|
|
{
|
|
var statusStr = await _trialRepository.Where(t => t.Id == trialId, ignoreQueryFilters: true).Select(t => t.TrialStatusStr).FirstOrDefaultAsync();
|
|
|
|
return statusStr;
|
|
}
|
|
}
|
|
}
|