internal override ICacheClient TryExecute(ICacheClient client) { if (!CanExecute) { return(client); } try { Console.WriteLine("This will delete ALL your data. Are you sure (y/n) ?"); var answer = Console.ReadLine()?.ToLower().StartsWith("y"); if (answer.HasValue && answer.Value) { client.DropDatabase(); } } catch (Exception) { // ignored } return(client); }
/// <summary> /// Delete all data from the database /// </summary> public void DropDatabase() { _client.DropDatabase(); }