using YBEE.EQM.Core; namespace YBEE.EQM.Application; /// /// 字典数据服务 /// public class SysDictDataService : ISysDictDataService, ITransient { private readonly IRepository _dictDataRep; public SysDictDataService(IRepository dictDataRep) { _dictDataRep = dictDataRep; } /// /// 获取所有字典列表 /// /// public async Task> GetAllList() { var items = await _dictDataRep.DetachedEntities//.Include(t => t.DictType) .Where(u => u.Status == CommonStatus.ENABLE) .OrderBy(u => u.Sort) .ProjectToType() .ToListAsync(); return items; } /// /// 通过字典类型ID获取字典列表 /// /// /// public async Task> GetListByDictTypeId(int dictTypeId) { var items = await _dictDataRep.DetachedEntities.Include(t => t.SysDictType) .Where(u => u.SysDictTypeId == dictTypeId && u.Status == CommonStatus.ENABLE) .OrderBy(u => u.Sort) .ProjectToType() .ToListAsync(); return items; } }