public ActionResult Index() { try { #region " [ Declaration ] " TimelineService _timelineService = new TimelineService(); CetificateService _cetificateService = new CetificateService(); ViewBag.timeline = _timelineService.GetAll(UserID); ViewBag.cetificate = _cetificateService.GetAll(UserID); #endregion return(View()); } catch (ServiceException serviceEx) { throw serviceEx; } catch (DataAccessException accessEx) { throw accessEx; } catch (Exception ex) { throw new ControllerException(FILE_NAME, "Index", UserID, ex); } }
public IActionResult Get() { try { return(Ok(_timelineService.GetAll().OrderBy(t => t.OrderYear))); } catch (Exception ex) { _logger.LogError("Could not get all timelines!", ex); return(BadRequest("Error occurred")); } }