public static decimal GetDecimalValue(this MetaStorageBase item, string fieldName, decimal defaultValue) { if (item.FieldExists(fieldName) && item[fieldName] != null) { decimal val; if (decimal.TryParse(item[fieldName].ToString(), out val)) { return(val); } } return(defaultValue); }
public static string GetStringValue(this MetaStorageBase item, string fieldName, string defaultValue) { return(item.FieldExists(fieldName) && item[fieldName] != null ? item[fieldName].ToString() : defaultValue); }