public async Task <PagedSearchDTO <EquipmentDto> > FindWithPageSearch(string name, string sortDirection, int pageSize, int page)
        {
            var sort   = (!string.IsNullOrWhiteSpace(sortDirection) && !sortDirection.Equals("desc")) ? "asc" : "desc";
            var size   = (pageSize < 1) ? 10 : pageSize;
            var offset = page > 0 ? (page - 1) * size : 0;

            string query = @"select * from equipments e  where 1 = 1 ";

            if (!string.IsNullOrWhiteSpace(name))
            {
                query += $"and e.name like '%{name}%'";
            }
            query += $"order by e.name {sort} limit {size} offset {offset}";

            string countQuery = @"select count(*) from equipments e  where 1 = 1 ";

            if (!string.IsNullOrWhiteSpace(name))
            {
                countQuery += $"and e.name like '%{name}%'";
            }

            var equipments = await _repository.FindWithPagedSearch(query);

            int totalResult = _repository.GetCount(countQuery);
            var result      = _mapper.Map <List <EquipmentDto> >(equipments);

            var searchPage = new PagedSearchDTO <EquipmentDto>
            {
                CurrentPage    = page,
                List           = result,
                PageSize       = size,
                SortDirections = sort,
                TotalResults   = totalResult
            };

            return(searchPage);
        }