public async Task <ActionResult <ConversationViewModel> > GetConversation(int id) { var conversation = await ConversationService.GetConversation(id); if (conversation == null) { return(NotFound()); } return(Ok(Mapper.Map <ConversationViewModel>(conversation))); }
private IList <Conversation> GetConversation(string from, string to, out int total) { const int pageIndex = (1); const int pageSize = 1000; long fromIsId, toIsId; var fromProfile = ParseKey(from, out fromIsId); var toProfile = ParseKey(to, out toIsId); var fromId = (fromIsId > 0 && fromProfile == null) ? fromIsId : fromProfile.Id; var toId = (toIsId > 0 && toProfile == null) ? toIsId : toProfile.Id; if (toId > 0 && fromId > 0) { return(ConversationService.GetConversation(fromId, toId, out total, pageIndex, pageSize)); } total = 0; return(null); }