public async Task <VacancyViewModel> GetVacancy(int id)
    {
        var vacancy = await _vacancyService.Get(id);

        await _vacancyService.IncreaseViewCount(id);

        var image = _vacancyService.GetVacancyImage();

        return(new VacancyViewModel(vacancy, _settings.WebSiteUrl, image));
    }
Beispiel #2
0
        public async Task <IActionResult> Vacancy(int id)
        {
            var vacancy = await _vacancyService.Get(id);

            if (vacancy == null)
            {
                return(NotFound());
            }

            await _vacancyService.IncreaseViewCount(id);

            var image = _vacancyService.GetVacancyImage();

            var model = new VacancyViewModel(vacancy, _settings.WebSiteUrl, image);

            ViewData["Title"] = model.Title;

            return(View("~/Views/Home/Vacancy.cshtml", model));
        }