Exemplo n.º 1
0
        private async Task <string> DeleteStringConfig(List <string> commandWords)
        {
            if (commandWords.Count != 4)
            {
                return("You must specify a config name and value to be deleted.");
            }

            if (!_configRepository.GetStringConfig(commandWords[2]).Contains(commandWords[3], StringComparer.OrdinalIgnoreCase))
            {
                return($"String config name:value pair {commandWords[2]}:{commandWords[3]} does not exist.");
            }

            await _configRepository.DeleteStringConfig(commandWords[2].ToLower(CultureInfo.InvariantCulture), commandWords[3]);

            return($"Config has been updated: {commandWords[2]}:{commandWords[3]} has been deleted.");
        }