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())); } }
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)); } }
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)); } }
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); }
private WordService() { staticDao = new WordDAO(); }