| | |
| | | public class DictionaryDatasQueryHandler( |
| | | IRepository<DictionaryData> rep |
| | | ) : IRequestHandler<GetDictionaryDatasQuery, PagedListQueryResult<GetDictionaryDatasQueryResultItem>>, |
| | | IRequestHandler<GetDictionaryDataSelectQuery, List<SelectOption<Guid, GetDictionaryDataSelectQueryResultOption>>> |
| | | IRequestHandler<GetDictionaryDataSelectQuery, List<SelectOption<string, GetDictionaryDataSelectQueryResultOption>>> |
| | | { |
| | | private readonly IRepository<DictionaryData> rep = rep; |
| | | |
| | |
| | | /// <param name="request"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | public Task<List<SelectOption<Guid, GetDictionaryDataSelectQueryResultOption>>> Handle(GetDictionaryDataSelectQuery request, CancellationToken cancellationToken) |
| | | public Task<List<SelectOption<string, GetDictionaryDataSelectQueryResultOption>>> Handle(GetDictionaryDataSelectQuery request, CancellationToken cancellationToken) |
| | | { |
| | | return request.GetSelect<DictionaryData, Guid, GetDictionaryDataSelectQueryResultOption>( |
| | | it => it.Id, |
| | | return request.GetSelect<DictionaryData, string, GetDictionaryDataSelectQueryResultOption>( |
| | | it => it.Code, |
| | | it => it.Content, |
| | | q => |
| | | { |
| | |
| | | { |
| | | q = q.Where(it => it.ParentId == request.ParentId); |
| | | } |
| | | if (request.MaxDeep.HasValue) |
| | | { |
| | | q = q.Where(it => it.Deep <= request.MaxDeep); |
| | | } |
| | | if (request.Keywords.IsNotNull()) |
| | | { |
| | | q = q.Where(it => |