public async Task <IActionResult> Edit(EditJobOfferViewModel model) { if (!ModelState.IsValid) { model.JobCategories = await _jobCategoryService.GetAllCategories(); model.JobTypes = await _jobTypeService.GetAllTypes(); return(View(model)); } var offer = _mapper.Map <JobOffer>(model); var result = await _jobOfferService.Edit(offer); if (result) { return(RedirectToAction(nameof(Index))); } return(View("NotFound")); }