Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        public void UpdateTournamentInfo(LiteDatabase db, TournamentInfo t)
        {
            var collection = db.GetCollection <TournamentInfo>("tournaments");

            collection.Update(t);
        }