mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-03-31 06:06:36 +08:00
简化对象映射Mapper,简化自定义仓储
This commit is contained in:
@@ -23,11 +23,15 @@ namespace Yi.RBAC.Application.Dictionary
|
||||
private IDictionaryRepository _dictionaryRepository { get; set; }
|
||||
public override async Task<PagedResultDto<DictionaryGetListOutputDto>> GetListAsync(DictionaryGetListInputVo input)
|
||||
{
|
||||
var data = await _dictionaryRepository.SelectGetListAsync(await MapToEntityAsync(input), input);
|
||||
int total = 0;
|
||||
var entities = await _DbQueryable.WhereIF(input.DictType is not null, x => x.DictType == input.DictType)
|
||||
.WhereIF(input.DictLabel is not null, x => x.DictLabel!.Contains(input.DictLabel!))
|
||||
.WhereIF(input.State is not null, x => x.State == input.State)
|
||||
.ToPageListAsync(input.PageNum, input.PageSize, total);
|
||||
return new PagedResultDto<DictionaryGetListOutputDto>
|
||||
{
|
||||
Total = data.Total,
|
||||
Items = await MapToGetListOutputDtosAsync(data.Items)
|
||||
Total = total,
|
||||
Items = await MapToGetListOutputDtosAsync(entities)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user