public ActionResult ViewChat(int groupId) { Account account = GetAccount(); GroupChatModel model = new GroupChatModel(); Group group = groupRepository.GetGroup(groupId); model.GroupOwner = groupLogic.GetGroupOwner(account.AccountId, group); model.GroupName = group.GroupName; model.GroupMessages = groupLogic.GetGroupMessages(account.AccountId, group).OrderByDescending(x => x.GroupMessage.MessageSent); // newest first model.GroupId = group.GroupId; model.Participants = groupLogic.GetParticipants(group.Accounts, account.AccountId); return(View(model)); }