示例#1
0
        public override int GetHashCode()
        {
            var hashCode = 175731186;

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Id);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(UserId);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Image);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Content);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Quote);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Market);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Recommend);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Price);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Access);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Forecast);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(CreatedAt);

            hashCode = hashCode * -1521134295 + IsQuoteFavorite.GetHashCode();
            hashCode = hashCode * -1521134295 + CommentCount.GetHashCode();
            hashCode = hashCode * -1521134295 + LikeCount.GetHashCode();
            hashCode = hashCode * -1521134295 + IsLiked.GetHashCode();
            return(hashCode);
        }
示例#2
0
        public ActionResult <LikeCount> getLikes(int id)
        {
            var likeCount = new LikeCount();

            likeCount.Count = 10;
            return(Ok(likeCount));
        }
示例#3
0
 private void AddOrRemoveEvent(bool addEvent)
 {
     try
     {
         switch (addEvent)
         {
         // true +=  // false -=
         case true:
             UserAvatar?.SetOnClickListener(this);
             Username?.SetOnClickListener(this);
             CommentLinearLayout?.SetOnClickListener(this);
             CommentCount?.SetOnClickListener(this);
             ShareLinearLayout?.SetOnClickListener(this);
             LikeButton?.SetOnClickListener(this);
             LikeButton?.SetOnLongClickListener(this);
             MoreIcon?.SetOnClickListener(this);
             LikeCount?.SetOnClickListener(this);
             SecondReactionButton?.SetOnClickListener(this);
             break;
         }
     }
     catch (Exception e)
     {
         Methods.DisplayReportResultTrack(e);
     }
 }
示例#4
0
        public async Task <IActionResult> AddLike([FromBody] Comments model)
        {
            var UserId = "";
            var Email  = "";
            var user   = await _userManager.GetUserAsync(User);

            if (user == null)
            {
                UserId = "0";
                Email  = "Anonymous";
            }
            else
            {
                UserId = user.Id;
                Email  = user.Email;
            }

            try
            {
                if (ModelState.IsValid)
                {
                    LikeCount LikeCountFromDb = await _db.LikeCount.Where(l => l.PostId == model.PostId).FirstOrDefaultAsync();

                    if (LikeCountFromDb == null)
                    {
                        var LikeCountModel = new LikeCount()
                        {
                            UserId = UserId,
                            PostId = model.PostId
                        };
                        _db.LikeCount.Add(LikeCountModel);
                    }
                    else
                    {
                        LikeCountFromDb.Count = LikeCountFromDb.Count + 1;
                    }
                    await _db.SaveChangesAsync();
                }
                return(Json(new { status = "ok" }));
            }
            catch (Exception e)
            {
                return(Json(new { status = e.Message }));
            }
        }
示例#5
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (WatchingCount.Length != 0)
            {
                hash ^= WatchingCount.GetHashCode();
            }
            if (LikeCount.Length != 0)
            {
                hash ^= LikeCount.GetHashCode();
            }
            if (LikeDelta != 0)
            {
                hash ^= LikeDelta.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
示例#6
0
 private void AddOrRemoveEvent(bool addEvent)
 {
     try
     {
         // true +=  // false -=
         if (addEvent)
         {
             UserAvatar?.SetOnClickListener(this);
             Username?.SetOnClickListener(this);
             CommentLinearLayout?.SetOnClickListener(this);
             CommentCount?.SetOnClickListener(this);
             ShareLinearLayout?.SetOnClickListener(this);
             LikeButton?.SetOnClickListener(this);
             LikeButton?.SetOnLongClickListener(this);
             MoreIcon?.SetOnClickListener(this);
             LikeCount?.SetOnClickListener(this);
             SecondReactionButton?.SetOnClickListener(this);
         }
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }