public async Task <ActionResult> Get() { try { GetGameHistoryView view = await _gameHistoryService.Get(); string jsonResult = JsonConvert.SerializeObject(view); return(Content(jsonResult, "application/json")); } catch (Exception exception) { string message = exception.ToString(); _logger.Error(message); return(RedirectToAction("Display", "Error", new { message = GameMessage.HistoryMessagesError })); } }
public IHttpActionResult Get() { var gamesHistory = _gameHistoryService.Get(); return(Ok(gamesHistory)); }