コード例 #1
0
ファイル: VocabularyHub.cs プロジェクト: EAlhovik/Vocabulary
        public void GetDescriptionForModal(String key)
        {
            var uow = new VocabularyUow(new VocabularyDbContext());
            IVocabularyService vocabularyService = new VocabularyService(uow);

            Word word = vocabularyService.GetByKey(key);
            Clients.PublishDescriptionForModal(word);
        }
コード例 #2
0
ファイル: VocabularyHub.cs プロジェクト: EAlhovik/Vocabulary
        public void GetDescription(String key)
        {
            var uow = new VocabularyUow(new VocabularyDbContext());
            IVocabularyService vocabularyService = new VocabularyService(uow);

            Word word = vocabularyService.GetByKey(key);
            Clients.PublishDescription(word.Key, word.Theme, word.Description);
        }
コード例 #3
0
ファイル: VocabularyHub.cs プロジェクト: EAlhovik/Vocabulary
        public void SearchWords(String term, ThemeEnum theme)
        {
            var uow = new VocabularyUow(new VocabularyDbContext());
            ISearchService searchService = new SearchService(uow);

            foreach (var item in searchService.SearchByTerm(term, theme))
            {
                Clients.PublishWords(item.Key);
            }
        }
コード例 #4
0
ファイル: VocabularyHub.cs プロジェクト: EAlhovik/Vocabulary
        public void UpdateWord(Word word)
        {
            var uow = new VocabularyUow(new VocabularyDbContext());
            IVocabularyService vocabularyService = new VocabularyService(uow);

            try
            {
                vocabularyService.UpdateWord(word);
                Clients.PublishUpdated("Успех!");
            }
            catch(Exception)
            {
                Clients.PublishUpdated("Ошибка");

            }
        }