Ejemplo n.º 1
0
 public async Task <long> GetCountAsync(SystemDictionaryResultRequestDto input, CancellationToken cancellationToken = default)
 {
     return(await this
            .WhereIf(
                !input.Id.IsNullOrEmpty(),
                o => o.Id == Guid.Parse(input.Id)
                )
            .LongCountAsync(GetCancellationToken(cancellationToken)));
 }
Ejemplo n.º 2
0
 /// <summary>
 ///     字典分页信息
 /// </summary>
 /// <returns></returns>
 public async Task <List <SystemDictionary> > PagingDictionaryQuery(SystemDictionaryResultRequestDto input,
                                                                    CancellationToken cancellationToken = default)
 {
     return(await DbSet
            .WhereIf(
                !input.Id.IsNullOrEmpty(),
                o => o.Id == Guid.Parse(input.Id)
                )
            .OrderBy(input.Sorting ?? nameof(SystemDictionary.CreateTime))
            .PageBy(input.SkipCount, input.MaxResultCount)
            .ToListAsync(GetCancellationToken(cancellationToken)));
 }
        /// <summary>
        ///     字典分页信息
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public async Task <PagedResultDto <SystemDictionaryOutput> > PagingDictionaryQuery(SystemDictionaryResultRequestDto query)
        {
            var list = await _systemDictionaryRepository.PagingDictionaryQuery(query);

            var totalCount = await _systemDictionaryRepository.GetCountAsync(query);

            return(new PagedResultDto <SystemDictionaryOutput>(
                       totalCount,
                       ObjectMapper.Map <List <SystemDictionary>, List <SystemDictionaryOutput> >(list)
                       ));
        }
 public async Task <PagedResultDto <SystemDictionaryOutput> > GetPagingDictionary(SystemDictionaryResultRequestDto queryParam)
 {
     return(await _systemDictionaryLogic.PagingDictionaryQuery(queryParam));
 }