// GET api/<controller>
 public IEnumerable <ConversationSnapShot> Get()
 {
     try
     {
         int _UserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name);
         List <ConversationSnapShot> _SentConversation = new ConversationSnapShot().GetUserSentConversationSnapshot(_UserID);
         return(_SentConversation);
     }
     catch (Exception)
     {
         return(null);
     }
 }
示例#2
0
        public int Get()
        {
            try
            {
                if (HttpContext.Current.User.Identity.Name == "")
                {
                    return(0);
                }

                int _UserID               = Convert.ToInt32(HttpContext.Current.User.Identity.Name);
                var _GetRecivedMessages   = new ConversationSnapShot().GetUserReceivedConversationSnapshot(_UserID);
                int _recivedMessagesCount = _GetRecivedMessages.Where(x => x.LastConversation.HasRecipientSeen == false && x.LastConversation.IsDeletedByRecipient == false).ToArray().Count();
                return(_recivedMessagesCount);
            }
            catch (Exception)
            {
                return(0);
            }
        }