Exemplo n.º 1
0
 public int DeleteWord(Word request)
 {
     using (var db = DbConnectionFactory.OpenDbConnection())
     {
         return db.DeleteFmt<Word>("chinese = {0}", request.chinese);
     }
 }
Exemplo n.º 2
0
 public int AddWord(Word request)
 {
     using (var db = DbConnectionFactory.OpenDbConnection())
     {
         db.CreateTableIfNotExists<Word>();
         return (int)(db.Insert(request));
     }
 }
Exemplo n.º 3
0
 public int Delete(WordByChinese request)
 {
     var word = new Word()
     {
         chinese = request.chinese,
     };
     return Repo.DeleteWord(word);
 }
Exemplo n.º 4
0
 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);
 }
Exemplo n.º 5
0
 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 };
 }