//Chat history return parameter public void ChatHistory(string conversationid, string connectionID) { var history = db.ChatHistory(Convert.ToInt32(conversationid)); foreach (var item in history.ToList()) { Clients.Client(connectionID).addNewMessageToPage(item.FullName, item.Message, item.DateSent.ToString()); } }