public CreateTables() { using (var ctx = new MySqlContext()) { connection = ctx.GetConnection(); CreateUserTable(); CreateApiKeyTable(); } }
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"); }; }