Example #1
0
        public static Dictionary <int, LandingCompetition> ReadCompetitions()
        {
            Dictionary <int, LandingCompetition> competitions = new Dictionary <int, LandingCompetition>();

            using (DatabaseConnection dbClient = Alias.Server.DatabaseManager.GetConnection())
            {
                using (MySqlDataReader Reader = dbClient.DataReader("SELECT * FROM `landing_competitions`"))
                {
                    while (Reader.Read())
                    {
                        LandingCompetition competiton = new LandingCompetition()
                        {
                            Name  = Reader.GetString("name"),
                            Users = ReadCompetitionUsers(Reader.GetString("query"))
                        };
                        if (!competitions.ContainsKey(Reader.GetInt32("id")))
                        {
                            competitions.Add(Reader.GetInt32("id"), competiton);
                        }
                    }
                }
            }
            return(competitions);
        }
Example #2
0
 public bool TryGetCompetition(int id, out LandingCompetition data)
 {
     return(this.Competitions.TryGetValue(id, out data));
 }