Esempio n. 1
0
        public IActionResult GetEvents()
        {
            try
            {
                var events = _repo.GetAllEventInfo()
                             .OrderByDescending(e => e.Moniker)
                             .ToArray();

                return(Ok(_mapper.Map <IEnumerable <EventInfoViewModel> >(events)));
            }
            catch (Exception ex)
            {
                _logger.LogError("Failed to read events. {0}", ex);

                return(BadRequest("Failed to get events"));
            }
        }