Ejemplo n.º 1
0
        public List <CharacterEpisodeDTO> GetIncludeAll()
        {
            var source = _character.GetIncludeAsync(x => x.Episodes, y => y.Friends).ToList();
            var result = MapForDto.MapForDTO(source);

            return(result);
        }
Ejemplo n.º 2
0
        public List <CharacterEpisodeDTO> GetIncludeAllwPagination([FromUri] PagingParameterModel pagingParameterModel)
        {
            var input  = _character.GetIncludeAsync(x => x.Episodes, y => y.Friends).ToList();
            var result = MapForDto.MapForDTO(input);

            if (pagingParameterModel != null)
            {
                var output = Pagination.PaginateForResult(pagingParameterModel, result);
                HttpContext.Current.Response.Headers.Add("Paging-Headers", JsonConvert.SerializeObject(output.paginationModel));
                return(output.items);
            }
            return(result);
        }