public static List <string> GetAsList <T>(T nome, char separator = ',') { if (String.IsNullOrEmpty(ConfiguracaoAppUtil.Get(nome))) { return(new List <string>()); } else { return(ConfiguracaoAppUtil.Get(nome).Split(separator).Select(t => t.Trim()).ToList()); } }
public static Dictionary <string, decimal> GetAsDictionaryDecimal <T>(T nome, char separator = ',', char separatorValue = '=') { var list = ConfiguracaoAppUtil.Get(nome).Split(separator); if ((list.Length > 0) && (list[0].Trim().Contains(separatorValue))) { return(list.ToDictionary <string, string, decimal>(t => t.Split(separatorValue)[0].Trim(), t => Convert.ToDecimal(t.Split(separatorValue)[1].Trim()))); } else { return(new Dictionary <string, decimal>()); } }
public static double GetAsDouble <T>(T nome) { return(Convert.ToDouble(ConfiguracaoAppUtil.Get(nome))); }
public static List <decimal> GetAsListDecimal <T>(T nome, char separator = ',') { return(ConfiguracaoAppUtil.GetAsList(nome, separator).Select(t => Convert.ToDecimal(t.Trim())).ToList()); }
public static decimal GetAsDecimal <T>(T nome) { return(Convert.ToDecimal(ConfiguracaoAppUtil.Get(nome))); }
public static List <int> GetAsListInt <T>(T nome, char separator = ',') { return(ConfiguracaoAppUtil.GetAsList(nome, separator).Select(t => Convert.ToInt32(t.Trim())).ToList()); }
public static int GetAsInt <T>(T nome) { return(Convert.ToInt32(ConfiguracaoAppUtil.Get(nome))); }
public static List <DateTime> GetAsListDateTime <T>(T nome, char separator = ',') { return(ConfiguracaoAppUtil.GetAsList(nome, separator).Select(t => t.ToDateTime()).ToList()); }
public static DateTime GetAsDateTime <T>(T nome) { return(ConfiguracaoAppUtil.Get(nome).ToDateTime()); }
public static List <bool> GetAsListBool <T>(T nome, char separator = ',') { return(ConfiguracaoAppUtil.GetAsList(nome, separator).Select(t => Convert.ToBoolean(t.Trim())).ToList()); }
public static bool GetAsBool <T>(T nome) { return(Convert.ToBoolean(ConfiguracaoAppUtil.Get(nome))); }