public static int GetValueByDescription(IDictionary <string, int> pais, string description, int defaultValue) { if (pais.Count == 0 && string.IsNullOrEmpty(description)) { return(defaultValue); } var key = pais.Keys.FirstOrDefault(model => StringHelper.Compare(model, description)); return(string.IsNullOrEmpty(key) ? defaultValue : pais[key]); }