コード例 #1
0
        public virtual IActionResult ApiStandardsByFrameworkByFrameworkIdGet([FromRoute][Required] string frameworkId, [FromQuery] int?pageIndex, [FromQuery] int?pageSize)
        {
            IEnumerable <Standard> standards;
            int totalPages;

            try
            {
                standards = _datastore.ByFramework(frameworkId);
                standards = _datastore.GetPagingValues(pageIndex, pageSize, standards, out totalPages);
            }
            catch (Crm.CrmApiException ex)
            {
                return(StatusCode((int)ex.HttpStatus, ex.Message));
            }

            return(new ObjectResult(new PaginatedListStandards()
            {
                Items = standards.ToList(),
                TotalPages = totalPages,
                PageIndex = pageIndex ?? Paging.DefaultIndex,
                PageSize = pageSize ?? Paging.DefaultPageSize
            }));
        }
コード例 #2
0
 public IEnumerable <Standards> ByFramework(string frameworkId)
 {
     return(_datastore.ByFramework(frameworkId));
 }