public async Task <ActionResult <IEnumerable <Calendar> > > GetCalendar() { try { var price = await _repository.GetCalendar(); return(Ok(price)); } catch (Exception exc) { _logger.LogError($"Error: {exc}"); // transaction.Rollback(); return(NotFound()); } }
public CalendarViewModel GetCalendar(int id) { var calendar = _caRepository.GetCalendar(id); if (calendar == null) { throw new NotFoundException("Calendar not found"); } return(_mapper.Map <Calendar, CalendarViewModel>(calendar)); }
public IActionResult Index() { return(View(_calendarRepository.GetCalendar())); }
public async Task <IActionResult> Get(int id) { return(Ok(await _calendarRepository.GetCalendar(id))); }