Beispiel #1
0
        public JsonResult GetRandon()
        {
            _allWords.Words.Shuffle();
            WordsResponse resp = new WordsResponse {
                Words = _allWords.Words.Take(10).ToList()
            };

            return(new JsonResult(resp));
        }
Beispiel #2
0
        public WordsController()
        {
            using (StreamReader r = new StreamReader("Data/all.json")) {
                string json = r.ReadToEnd();
                _allWords = JsonConvert.DeserializeObject <WordsResponse> (json);
            }

            using (StreamReader r = new StreamReader("Data/current.json")) {
                string json = r.ReadToEnd();
                _currentWords = JsonConvert.DeserializeObject <WordsResponse> (json);
            }
        }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ApplyStyleToDocumentElementOnlineResponse"/> class.
 /// </summary>
 /// <param name="model">The response model.</param>
 /// <param name="document">The document after modification.</param>
 public ApplyStyleToDocumentElementOnlineResponse(WordsResponse model, System.IO.Stream document)
 {
     this.Model    = model;
     this.Document = document;
 }
Beispiel #4
0
        public async Task <IEnumerable <WordsResponse> > GetAsync()
        {
            var existingWords = await unitOfWork.SearchKeyRepository.GetAllWords();

            return(existingWords.Select(x => WordsResponse.Create(x)));
        }