public async Task <bool> IsExists(Bookmark_Like_Model filter)
        {
            List <Bookmark_Like_Model> existingRecords = await this.ReadFromStorage();

            Bookmark_Like_Model found = Filter(existingRecords, filter);

            return(found != null);
        }
        public async Task <bool> Add(Bookmark_Like_Model filter)
        {
            bool retVal = false;

            List <Bookmark_Like_Model> existingRecords = await this.ReadFromStorage();

            Bookmark_Like_Model foundRecord = Filter(existingRecords, filter);

            if (foundRecord == null)
            {
                existingRecords.Add(filter);
                retVal = await base.SaveAsync(SecureStorageKey.ToolBarStorage, existingRecords);
            }

            return(retVal);
        }
        private async void CreateLike_Tapped(object sender, EventArgs e)
        {
            // Stat.totalLikes = 4;
            PostLikeResponseModel responseModel = new PostLikeResponseModel();
            bool isalreadyLiked = isLiked.ToLower() == "true";

            Enums.TGA_Type      _type = Type.ParseToEnum <Enums.TGA_Type>();
            Bookmark_Like_Model model = new Bookmark_Like_Model
            {
                FeedId = PostId,
                Type   = _type,
                Module = Enums.Module.Like
            };

            int likeValue = 1;

            if (isalreadyLiked)
            {
                var retVal = await bookMarkStorageService.Remove(model);

                likeValue     = -1;
                responseModel = await dashBoardService.AddLike(post_id : PostId, post_type : Type, likeValue, Enums.Views.DashBoard);

                if (responseModel.Code == 200)
                {
                    isLiked = "false";
                }
            }
            else
            {
                var retVal = await bookMarkStorageService.Add(model);

                responseModel = await dashBoardService.AddLike(post_id : PostId, post_type : Type, likeValue, Enums.Views.DashBoard);

                if (responseModel.Code == 200)
                {
                    isLiked = "true";
                }
            }

            Stat.totalLikes = Convert.ToInt32(responseModel.Like);
        }
        private Bookmark_Like_Model Filter(List <Bookmark_Like_Model> existingRecords, Bookmark_Like_Model model)
        {
            Bookmark_Like_Model entity = existingRecords.FirstOrDefault(x => x.FeedId == model.FeedId && x.Module == model.Module && x.Type == model.Type);

            return(entity);
        }