Example #1
0
        public Task <PreProcessedOffsetPageResults <IStarWarsCharacter> > GetStarWarsCharactersWithOffsetPagingAsync(
            [GraphQLParams] IParamsContext paramsContext,
            bool testEmptyResults = false
            )
        {
            var characters = testEmptyResults
                ? Enumerable.Empty <IStarWarsCharacter>()
                : StarWarsCharacterRepo.CreateCharacters();

            var results = characters.SliceAsOffsetPage(paramsContext.OffsetPagingArgs);

            return(Task.FromResult(results.AsPreProcessedPageResults()));
        }
Example #2
0
        public Task <IEnumerable <IStarWarsCharacter> > GetStarWarsCharactersAsync()
        {
            var results = StarWarsCharacterRepo.CreateCharacters();

            return(Task.FromResult(results));
        }