public async Task <IActionResult> Index() { IEnumerable <ContactDto> ContatViews = (await lawyerDbContext.GetContactViewAsync()) .Where(m => m.LanguageId == DbContextService.GetLanguageIdByShortName(lawyerDbContext)); return(View(ContatViews)); }
public async Task <IActionResult> Index([FromRoute] string culture) { IndexViewModel indexViewModel = null; try { int?languageId = DbContextService.GetLanguageIdByShortName(lawyerDbContext, culture); if (languageId == null) { return(NotFound()); } indexViewModel = new IndexViewModel { Sliders = await lawyerDbContext.Sliders.ToListAsync(), Areas = (await lawyerDbContext.GetAreaViewAsync()) .Where(m => m.LanguageId == languageId) .ToList(), Contact = (await lawyerDbContext.GetContactViewAsync()) .SingleOrDefault(m => m.LanguageId == languageId), TeamService = (await lawyerDbContext.GetTeamServicesViewAsync()) .SingleOrDefault(m => m.LanguageId == languageId) }; } catch { return(NotFound()); } return(View(indexViewModel)); }