public static async Task <LanguageEdit> GetLanguageEditAsync(string languageText) { LanguageEdit retLanguage = null; //HACK: GETLANGUAGEEDIT BY LANGUAGE TEXT. RIGHT NOW, THIS GETALL'S THE LANGUAGES AND LOOKS IN THAT RESULT.. NEED TO IMPLEMENT THIS IN LANGUAGEDAL (GETLANGUAGEBYTEXT). var allLanguages = await LanguageList.GetAllAsync(); try { var results = (from language in allLanguages where language.Text == languageText select language); if (results.Count() > 0) { retLanguage = results.First(); } return(retLanguage); } catch (Exception ex) { throw new DataAccess.Exceptions.GeneralDataAccessException(ex); } }
public static async Task <Guid> GetDefaultLanguageIdAsync() { var allLanguages = await LanguageList.GetAllAsync(); Guid defaultLanguageId = Guid.Empty; try { defaultLanguageId = (from language in allLanguages where language.Text == DalResources.DefaultEnglishLanguageText select language).First().Id; return(defaultLanguageId); } catch (Exception ex) { throw new DataAccess.Exceptions.GeneralDataAccessException(ex); } }