public async Task <IActionResult> Edit(BanEditViewModel viewModel) { if (ModelState.IsValid) { var dto = _mapper.Map <BanEditDto>(viewModel); await _banService.EditAsync(dto); return(RedirectToAction("Details", new { id = dto.Id })); } else { ViewBag.ErrorMessage = ModelState.ModelErrorsToString(); return(View(viewModel)); } }