public async Task <IActionResult> GetAllDestinationsAsync( [FromQuery] PagingOptions pagingOptions, [FromQuery] SortOptions sortOptions, [FromQuery] SearchOptions searchOptions, CancellationToken cancellationToken = default(CancellationToken)) { pagingOptions.PageNumber = pagingOptions.PageNumber ?? ApiSettings.DefaultPageNumber; pagingOptions.PageSize = pagingOptions.PageSize ?? ApiSettings.DefaultPageSize; var query = new GetDestinationsPreviewQuery { PageNumber = pagingOptions.PageNumber.Value, PageSize = pagingOptions.PageSize.Value, OrderBy = sortOptions.OrderBy, Query = searchOptions.Query }; var result = await Mediator.Send(query, cancellationToken).ConfigureAwait(false); var destinations = Mapper.Map <IList <Destination> >(result); var response = ResponseFactory.CreatePagedReponse(destinations, typeof(DestinationsController), query, ResponseStatus.Success, "1.0.0"); return(Ok(response)); }