public async Task <IActionResult> DeleteCategory(int id) { var category = await _shopManager.GetCategoryByIdAsync(id); if (category == null) { return(View("Error", new ErrorViewModel { Message = $"Категория с id {id} не найдена." })); } var catDto = _mapper.Map <CategoryDto>(category); return(View(catDto)); }