Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }