using YBEE.EQM.Core; namespace YBEE.EQM.Application; /// /// 分数段服务 /// public class ExamScoreRangeService : IExamScoreRangeService, ITransient { private readonly IRepository _rep; private List _examScoreRanges; public ExamScoreRangeService(IRepository rep) { _rep = rep; } /// /// 获取分数段列表 /// /// /// public async Task> GetList(ExamScoreRangeType? type = null) { _examScoreRanges ??= await _rep.DetachedEntities.ProjectToType().OrderBy(t => t.Sequence).ToListAsync(); if (type.HasValue) { return _examScoreRanges.Where(t => t.Type == type.Value).ToList(); } return _examScoreRanges; } public async Task GetExamScoreRangeIdByTypeScore(ExamScoreRangeType type, decimal score) { var items = await GetList(type); } }