async public Task <ActionResult <IEnumerable <WordsDto> > > GetAllWords(string filter)
        {
            var wordsItems = await _repository.GetAllWords(filter);

            if (wordsItems != null)
            {
                return(Ok(_mapper.Map <IEnumerable <WordsDto> >(wordsItems)));
            }
            return(NotFound());
        }
Esempio n. 2
0
        public WordPair[] GetAllWords(QueryCriteria queryCriteria = null)
        {
            var orderByCreatedAtDescCriteria = new QueryCriteria
            {
                OrderByCriteria = new OrderByCriteria {
                    OrderBy = OrderBy.CreatedAt, SortOrder = SortOrder.DESC
                }
            };

            if (queryCriteria == null)
            {
                queryCriteria = orderByCreatedAtDescCriteria;
            }
            else if (queryCriteria.OrderByCriteria == null)
            {
                queryCriteria.OrderByCriteria = orderByCreatedAtDescCriteria.OrderByCriteria;
            }

            WordPair[] words = _wordsRepository.GetAllWords(queryCriteria);

            return(words);
        }
Esempio n. 3
0
 public IEnumerable <string> GetAllWords()
 {
     return(_repository.GetAllWords());
 }
Esempio n. 4
0
 public EnglishTrainer(IUserProfileRepository userProfileRepository, IWordsRepository wordsRepository, int userId)
 {
     _userProfileRepository = userProfileRepository;
     _listOFWords           = wordsRepository.GetAllWords();
     SessionStart(userId);
 }
Esempio n. 5
0
 public OptimalGhostPlayer(IWordsRepository wordsRepository)
 {
     _wordsRepository = wordsRepository;
     _wordsDictionary = new StringTree(wordsRepository.GetAllWords());
     _random          = new Random();
 }