public ConfigInstance UpdateConfigurationInstance(ConfigInstance original, JObject newEditPayload, ConfigurationSetModel model) { var configModel = model.Configs.Single(s => s.Type == original.ConfigType); var newConfig = UpdateObject(original.ConstructNewConfiguration(), newEditPayload, configModel.ConfigurationProperties); original.SetConfiguration(newConfig); return(original); }
private object UpdateObject(ConfigInstance original, JContainer newEditPayload, ConfigurationModel model, ConfigurationIdentity configIdentity, IEnumerable <ConfigurationSet> requiredConfigurationSets) { if (original is ConfigCollectionInstance collection) { return(UpdateObject(collection, (JArray)newEditPayload, (ConfigurationOptionModel)model, configIdentity, requiredConfigurationSets)); } else { return(UpdateObject(original.ConstructNewConfiguration(), (JObject)newEditPayload, model.ConfigurationProperties, configIdentity, requiredConfigurationSets)); } }