Ejemplo n.º 1
0
        public async Task <PagedResult <ContentType> > GetAll(int pageNo, int pageSize, string orderByProperties, FilterNode filter = null)
        {
            var contentTypes = _contentTypeRepository.GetContentTypes();

            if (filter != null)
            {
                contentTypes = contentTypes.ApplyFilter(filter).ToList();
            }
            var result = new PagedResult <ContentType>(contentTypes, pageNo, pageSize, orderByProperties);

            return(await Task.FromResult(result));
        }
Ejemplo n.º 2
0
        public IActionResult GetContentTypes()
        {
            try
            {
                var result = _contentTypeRepository.GetContentTypes();

                if (result != null)
                {
                    return(Ok(result));
                }
                return(NotFound());
            }
            catch (Exception ex)
            {
                _logger.LogError(string.Format("Error occured while getting content types"), ex);
                return(new StatusCodeResult(StatusCodes.Status500InternalServerError));
            }
        }