Ejemplo n.º 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()));
     }
 }
Ejemplo n.º 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));
     }
 }
Ejemplo n.º 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));
     }
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 5
0
 private WordService()
 {
     staticDao = new WordDAO();
 }