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

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

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

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