private async Task <IPagedCollection <EmployeeDetail> > GetEmployeeList(GetEmployeeListQuery query)
        {
            var filter = _filterBuilder
                         .WhereAddressEquals(query.Address)
                         .WhereBirthDate(query.FromBirthDate, query.ToBirthDate)
                         .WhereCityEquals(query.City)
                         .WhereCountryEquals(query.Country)
                         .WhereEmailEquals(query.Email)
                         .WhereFaxEquals(query.Fax)
                         .WhereFirstNameEquals(query.FirstName)
                         .WhereHireDate(query.FromHireDate, query.ToHireDate)
                         .WhereLastNameEquals(query.LastName)
                         .WherePhoneEquals(query.Phone)
                         .WherePostalCodeEquals(query.PostalCode)
                         .WhereStateEquals(query.State)
                         .WhereTitleEquals(query.Title)
                         .Filter;

            var employeesFromDb = await _dbContext
                                  .Employees
                                  .TagWithQueryName(nameof(GetEmployeeList))
                                  .Where(filter)
                                  .Include(employee => employee.Manager)
                                  .OrderBy(query.Order, _orderBuilder)
                                  .ToPagedCollectionAsync <Employee>(query.PageNumber, query.PageSize);

            var employees = _mapper.Map <IReadOnlyList <EmployeeDetail> >(employeesFromDb);

            return(new PagedCollection <EmployeeDetail>(
                       employees,
                       employeesFromDb.ItemCount,
                       employeesFromDb.CurrentPageNumber,
                       employeesFromDb.PageSize));
        }
        public Task <IPagedCollection <EmployeeDetail> > Handle(GetEmployeeListQuery request, CancellationToken cancellationToken)
        {
            if (request is null)
            {
                throw new ArgumentNullException(nameof(request));
            }

            return(GetEmployeeList(request));
        }