public int DeleteWord(Word request) { using (var db = DbConnectionFactory.OpenDbConnection()) { return db.DeleteFmt<Word>("chinese = {0}", request.chinese); } }
public int AddWord(Word request) { using (var db = DbConnectionFactory.OpenDbConnection()) { db.CreateTableIfNotExists<Word>(); return (int)(db.Insert(request)); } }
public int Delete(WordByChinese request) { var word = new Word() { chinese = request.chinese, }; return Repo.DeleteWord(word); }
public int Delete(WordInformation request) { var word = new Word() { chinese = request.chinese, english = request.english, passed = request.passed, lastTested = request.lastTested }; return Repo.DeleteWord(word); }
public object Post(WordInformation submission) { var word = new Word() { chinese = submission.chinese, english = submission.english, passed = submission.passed, lastTested = submission.lastTested }; var id = Repo.AddWord(word); return new { Id = id }; }