public async Task <List <LogDto> > Handle(GetListQuery request, CancellationToken cancellationToken) { //Can also use Take() or Skip() for pagination var logEntityList = await _dbWrapper.GetList(); if (!string.IsNullOrEmpty(request.Severity)) { logEntityList = logEntityList.Where(s => s.Severity.ToLower() == request.Severity).ToList(); } return(_mapper.Map <List <LogDto> >(logEntityList)); }
public async Task <List <string> > Handle(GetSeverityOptionsQuery request, CancellationToken cancellationToken) { var logEntityList = await _dbWrapper.GetList(); return(logEntityList.Select(x => x.Severity).Distinct().ToList()); }