Exemplo n.º 1
0
        public async Task <ActionResult> GetChatHistory()
        {
            var history = await ChatHub.GetUserChatCache();

            return(Json(new
            {
                data = history.Select(chatdata => new
                {
                    Id = chatdata.Id,
                    UserName = chatdata.UserName,
                    ChatHandle = chatdata.ChatHandle,
                    Flair = chatdata.Flair,
                    Timestamp = chatdata.Timestamp.ToString("MM/dd/yyyy HH:mm:ss"),
                    Avatar = chatdata.Avatar,
                    Message = chatdata.Message,
                    KarmaTotal = chatdata.KarmaTotal,
                    IsBot = chatdata.IsBot,
                    IsTipBot = chatdata.IsTipBot
                }).ToList(),
                time = DateTime.UtcNow.ToString("MM/dd/yyyy HH:mm:ss")
            }));
        }