public int GetNumberOfPages(string filterOption = null, int pageSize = 20)
        {
            if (pageSize < 1)
            {
                pageSize = 20;
            }

            int numberOfRestaurants = _unitOfWork.RestaurantRepository.Get(FilterOptions.GetFilterFunction(filterOption)).Count();

            return((int)Math.Ceiling((double)numberOfRestaurants / pageSize));
        }
        public IEnumerable <Restaurant> Get(string filterOption = null, string sortOption = null, int pageSize = 20, int pageNumber = 1)
        {
            if (pageSize < 1)
            {
                pageSize = 20;
            }
            if (pageNumber < 1)
            {
                pageNumber = 1;
            }

            pageNumber -= 1;

            return(_unitOfWork.RestaurantRepository.Get(
                       FilterOptions.GetFilterFunction(filterOption), SortOptions.GetSortFunction(sortOption))
                   .Skip(pageNumber * pageSize).Take(pageSize));
        }