// POST api/<controller> public IEnumerable <IMConversation> Post([FromBody] GetIMClass GetIM) { int _UserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name); IMConversation[] m_IMConversations = new IMConversation().GetIMConversation(_UserID, GetIM.OtherUserID); return(m_IMConversations); }
public bool Post([FromBody] GetIMClass GetIM) { int _UserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name); bool ISUSerAbleToChat = new UserAccountSettings().ISUserAbleToChat(_UserID, GetIM.OtherUserID); return(ISUSerAbleToChat); }
public IEnumerable <IMConversation> Post([FromBody] GetIMClass GetIM) { try { int _UserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name); IMConversation[] m_IMConversations = new IMConversation().GetIMConversation(_UserID, GetIM.OtherUserID); return(m_IMConversations.Reverse().Take(10).OrderBy(x => x.SentTime)); } catch (Exception) { return(null); } }