public virtual IActionResult ApiSolutionsByFrameworkByFrameworkIdGet([FromRoute][Required] string frameworkId, [FromQuery] int?pageIndex, [FromQuery] int?pageSize) { IEnumerable <Solution> solutions; int totalPages; try { solutions = _datastore.ByFramework(frameworkId); solutions = _datastore.GetPagingValues(pageIndex, pageSize, solutions, out totalPages); } catch (Crm.CrmApiException ex) { return(StatusCode((int)ex.HttpStatus, ex.Message)); } return(new ObjectResult(new PaginatedListSolutions() { Items = solutions.ToList(), TotalPages = totalPages, PageIndex = pageIndex ?? Paging.DefaultIndex, PageSize = pageSize ?? Paging.DefaultPageSize })); }