public static void SetServicesList(string services)
{
var servicesData = new DataModels.CachedService
{
Expires = DateTime.Now.AddDays(1),
JsonCache = services
};
// TRUNCATE TABLE `cached_services`
// INSERT INTO `cached_services`
// Clear Table
var query = new MySqlCommand
{
CommandText = @"TRUNCATE TABLE `cached_services`"
};
MySqlConnector.RunSQLUpdateQuery(query);
// Add new Service List
query = new MySqlCommand
{
CommandText = @"INSERT INTO `cached_services`
(
`expires`,
`json_cache`
)
VALUES
(
@expires,
@json_cache
);
"
};
query.Parameters.AddWithValue("@expires", servicesData.Expires);
query.Parameters.AddWithValue("@json_cache", servicesData.JsonCache);
MySqlConnector.RunSQLUpdateQuery(query);
}