public void GetLeaders(DBEventHandler<User> completed) { var query = from u in Db.Dbc.Table<User>() orderby u.Points descending select u; Db.Execute(query, completed); }
public void GetRand(DBEventHandler<Question> completed) { var rand = new Random(); var query = from q in Db.Dbc.Table<Question>() where q.Text != null select q; query = query.Skip(rand.Next(0, 7)).Take(1); Db.Execute(query, completed); }
void IDBCollection.SetEventHandler(enDBEventHandler which, DBEventHandler handler) { switch (which) { case enDBEventHandler.OnRecordRead: OnRecordRead += handler; break; case enDBEventHandler.OnRecordCollectionAdd: OnRecordCollectionAdd += handler; break; default: break; } }
public void GetAnswerById(int id, DBEventHandler<Answer> completed) { var rand = new Random(); var query = from a in Db.Dbc.Table<Answer>() where a.QuestionId == id select a; Db.Execute(query, completed); /*return database.Table<Question>() .Join(database.Table<Answer>().Where(t => t.ThemeId == ThemeID) , (m, t) => new { mym = m, myt = t }) .Select(a => new Playlist { Name = a.mym.Name, ResId = a.mym.ResId, LoopStart = 0 }) .ToList();*/ }
public void GetAll(DBEventHandler<User> completed) { Db.ExecuteList(completed); }
void IDBCollection.SetEventHandler(enDBEventHandler which, DBEventHandler handler) { OnRecordRead += handler; }