public bool TryGet(string key, out string value)
 {
     if (_provider.TryGet(key, out value))
     {
         value = MorestachioConfig.CheckAndTransformValue(key, value, _options).Value;
         return(true);
     }
     return(false);
 }
Exemple #2
0
        /// <inheritdoc />
        public IConfigurationRoot Build()
        {
            var configurationRoot = _builder.Build();

            foreach (var keyValuePair in configurationRoot.AsEnumerable())
            {
                if (Options.TransformCondition(keyValuePair))
                {
                    var transformValue = MorestachioConfig
                                         .TransformValue(new KeyValuePair <string, string>(keyValuePair.Key, keyValuePair.Value), Options);
                    configurationRoot[transformValue.Key] = transformValue.Value;
                }
            }
            return(configurationRoot);
        }