Example #1
0
        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);
        }
Example #2
0
 /// <summary>
 /// Delete all data from the database
 /// </summary>
 public void DropDatabase()
 {
     _client.DropDatabase();
 }