public ActionResult Details(int id) { try { var invoiceDto = invoicesService.GetById(id); if (invoiceDto == null) { throw new Exception("Відправлення не знайдено."); } return(View("Details", mapper.Map <InvoiceViewModel>(invoiceDto))); } catch (Exception ex) { deliveryMessage.Title = "Відправлення"; deliveryMessage.Body = ex.Message; return(View("DeliveryMessage", deliveryMessage)); } }