Beispiel #1
0
        public IAsyncEnumerable <string> Search(IStatisticRepository repository, StatisticQueryRequest query, CancellationToken cancellationToken = default)
        {
            var qr = repository.GetAllItems(cancellationToken).IgnoreNull();

            if (!string.IsNullOrWhiteSpace(query.Category))
            {
                qr = qr.Where(x => x.Category == query.Category);
            }
            if (!string.IsNullOrWhiteSpace(query.Uri))
            {
                qr = qr.Where(x => x.Uri == query.Uri);
            }

            return(qr.Select(item => item.Id).IgnoreNull().Paging(query.Pagination));
        }