Exemple #1
0
 public CreateTables()
 {
     using (var ctx = new MySqlContext())
     {
         connection = ctx.GetConnection();
         CreateUserTable();
         CreateApiKeyTable();
     }
 }
Exemple #2
0
        public DataBaseTest() : base("db")
        {
            Get["/ping"] = _ =>
            {
                try
                {
                    using (var con = new MySqlContext())
                    {
                        if (con.GetConnection().Ping())
                        {
                            return("Connected");
                        }
                    }
                }
                catch (Exception e)
                {
                    return(e.Message);
                }

                return("Failed");
            };
        }