private static string GetValue(IDictionary <string, PropertyMetaData> placeholders, string key) { var returnValue = GetPropertyMetaData(placeholders, key); return(PropertyMetaData.SanitizeProperty(returnValue) == null ? string.Empty : PropertyMetaData.SanitizeProperty(returnValue).ToString()); }
private static PropertyMetaData GetPropertyMetaData(IDictionary <string, PropertyMetaData> placeholders, string key) { PropertyMetaData returnValue; if (!placeholders.TryGetValue(key, out returnValue)) { returnValue = new PropertyMetaData { Type = typeof(string), Value = string.Empty }; } return(returnValue); }
public static object SanitizeProperty(PropertyMetaData propertyMetaData) { return(SanitizeFunctions[propertyMetaData.Type](propertyMetaData)); }
public static object Sanitize(PropertyMetaData propertyMetaData, object defaultValue) { return(propertyMetaData.Value ?? defaultValue); }