Exemplo n.º 1
0
        private void UpdateOptions(object source, ConfigurationPropertyWithOptionsModelDefinition model)
        {
            var optionSet = optionSetFactory.Build(model);
            var orignal   = model.GetPropertyValue(source);

            optionSet.TryGetValue(orignal, out var actualValue);
            model.SetPropertyValue(source, actualValue);
        }
        private object GetPropertyValue(object source, ConfigurationPropertyWithOptionsModelDefinition propertyModel)
        {
            var value = propertyModel.GetPropertyValue(source);

            if (value == null)
            {
                return(null);
            }
            return(propertyModel.GetKeyFromObject(value));
        }