public async Task <ActionResult> SaveVacacny(VacancyViewModel vacancyViewModel, string redirectUrl) { if (!ModelState.IsValid) { return(View(vacancyViewModel)); } var vacancy = await repository.GetByIdAsync(vacancyViewModel.Id); if (vacancy != null) { UpdateModel(vacancyViewModel, vacancy); await repository.UpdateAsync(vacancy); } return(RedirectToLocal(redirectUrl)); }