private bool IsDuplicateMessage(List<NotificationTutor> list, NotificationTutor candidate)
 {
     foreach (NotificationTutor notification in list)
         if (notification.Type == Constants.NotificationType.MESSAGE && notification.UserFrom.ObjectId == candidate.UserFrom.ObjectId)
             return true;
     return false;
 }
 private bool IsDuplicateMessage(List <NotificationTutor> list, NotificationTutor candidate)
 {
     foreach (NotificationTutor notification in list)
     {
         if (notification.Type == Constants.NotificationType.MESSAGE && notification.UserFrom.ObjectId == candidate.UserFrom.ObjectId)
         {
             return(true);
         }
     }
     return(false);
 }
        protected void listNotifications_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            var query = new ParseQuery <NotificationTutor>();
            NotificationTutor notification = AsyncHelpers.RunSync(() => query.GetAsync(e.CommandName));

            if (notification.FirstSeenAt == null)
            {
                notification.FirstSeenAt = DateTime.Now;
                AsyncHelpers.RunSync(notification.SaveAsync);
            }
            if (notification.Type == Constants.NotificationType.MESSAGE)
            {
                Session["ConversationUserId"] = notification.UserFrom.ObjectId;
            }
            Response.Redirect(notification.RedirectLink);
        }