Exemple #1
0
 public bool save(Word word, Language language, bool async = false)
 {
     if (async)
     {
         using (var localDao = new WordDAO())
         {
             return(localDao.save(word, language.ToString()));
         }
     }
     else
     {
         return(staticDao.save(word, language.ToString()));
     }
 }
Exemple #2
0
 public List <Word> getAll(Language language, int maxLength, bool async = false)
 {
     if (async)
     {
         using (var localDao = new WordDAO())
         {
             return(localDao.findAll(language.ToString(), maxLength));
         }
     }
     else
     {
         return(staticDao.findAll(language.ToString(), maxLength));
     }
 }
Exemple #3
0
 public List <Word> getByFirstCharacterAndLength(Language language, char character, int length, bool async = false)
 {
     if (async)
     {
         using (var localDao = new WordDAO())
         {
             return(localDao.findyByFirstCharacterAndFixedLength(language.ToString(), character, length));
         }
     }
     else
     {
         return(staticDao.findyByFirstCharacterAndFixedLength(language.ToString(), character, length));
     }
 }
Exemple #4
0
        public bool saveList(List <Word> words, Language language, bool async = false)
        {
            DatabaseController.getInstance().addTable(language.ToString());
            DataTable wordTable = toDataTable(words);

            if (async)
            {
                using (var localDao = new WordDAO())
                {
                    localDao.saveBulk(wordTable, language.ToString());
                }
            }
            else
            {
                staticDao.saveBulk(wordTable, language.ToString());
            }
            return(true);
        }
Exemple #5
0
 private WordService()
 {
     staticDao = new WordDAO();
 }