public string GetLanguageCultureName(int languageId) { var languages = LangRepo.Load(); if (languages == null || languages.Count == 0) { return(null); } var langInfo = languages.FirstOrDefault(l => l.Id == languageId); return(langInfo == null ? String.Empty : langInfo.CultureName); }
public int?GetLanguageId(string cultureName) { var languages = LangRepo.Load(); if (languages == null || languages.Count == 0) { return(null); } var langInfo = languages.FirstOrDefault( l => String.Equals(l.CultureName, cultureName, StringComparison.OrdinalIgnoreCase)); return(langInfo == null ? (int?)null : langInfo.Id); }