예제 #1
0
 private void UpdateSuppliedProperties()
 {
     typeof(TModel).GetProperties().ToList().ForEach(property =>
     {
         var propertyValue      = GetPropertyValue(property.Name);
         var propertyEmptyValue = GetPropertyValue(property.Name, true);
         if (((propertyValue != null && !propertyValue.Equals(propertyEmptyValue)) ||
              (propertyValue == null && propertyValue != propertyEmptyValue)
              ) && !ConfigProperties.GetValue(Constants.CONST_SUPPLIED).ToList().Exists(p => p == property.Name))
         {
             SetConfigProperty(Constants.CONST_SUPPLIED, property.Name);
         }
     });
 }
예제 #2
0
        /// <summary>
        /// Method that sets configuration properties into ConfigProperties list
        /// </summary>
        /// <param name="name">Configuration name</param>
        /// <param name="property">Property name</param>
        private void SetConfigProperty(
            string name,
            string property
            )
        {
            var configProperties = ConfigProperties.Where(x => x.Key == name).SingleOrDefault();

            if (configProperties.IsDefault())
            {
                ConfigProperties.Add(name, new List <string> {
                    property
                });
            }
            else
            {
                configProperties.Value.Add(property);
            }
        }