public long registerTournamentToDB(LiteDatabase db, TournamentInfo t) { var collection = db.GetCollection <TournamentInfo>("tournaments"); long index = 0; try { index = collection.Insert(t); } catch (Exception ex) { Console.WriteLine(ex.Message); } collection.EnsureIndex(t => t.UID); return(index); }
public void UpdateTournamentInfo(LiteDatabase db, TournamentInfo t) { var collection = db.GetCollection <TournamentInfo>("tournaments"); collection.Update(t); }