Пример #1
0
        public async Task <IActionResult> Index()
        {
            //_vocabularyLogic.AddWord(new Word
            //{
            //    Description = "description",
            //    LanguageId = 1,
            //    PartOfSpeechId = 1,
            //    Spelling = "test"
            //}, User.FindFirst(ClaimTypes.NameIdentifier).Value);

            return(View(await _vocabularyLogic.GetUserWords(User.FindFirst(ClaimTypes.NameIdentifier).Value)));
        }
Пример #2
0
        public async Task <List <UserWordViewModel> > GetVocabulary()
        {
            List <UserWord> userWords = await _vocabularyLogic.GetUserWords(CurrentUserId);

            List <UserWordViewModel> result = userWords.Select(uw => new UserWordViewModel
            {
                UserWordId   = uw.Id,
                Spelling     = uw.Word.Spelling,
                Description  = uw.Word.Description,
                Language     = uw.Word.Language.Name,
                PartOfSpeech = uw.Word.PartOfSpeech.Name,
                Level        = uw.Word.Level.Name
            }).ToList();

            return(result);
        }