public ActionResult RSSFeeds(int id)
        {
            try
            {
                string currentUserId = HttpContext.User.Identity.GetUserId();
                var    subscription  = _subscriptionRepo.GetSingle(x => x.Id == id);
                model.SubscriptionId = subscription.Id;
                WebClient wclient = new WebClient();
                string    RSSData = wclient.DownloadString(subscription.URL);
                XDocument xml     = XDocument.Parse(RSSData);
                var       sub     = (from x in xml.Descendants("channel")
                                     select new Subscription
                {
                    LastPublishedDate = DateTime.Parse(((string)x.Element("lastBuildDate")))
                });
                var RSSFeedData = (from x in xml.Descendants("item")
                                   select new RSSFeed
                {
                    Title = ((string)x.Element("title")),
                    Link = ((string)x.Element("link")),
                    Description = ((string)x.Element("description")),
                    PubDate = ((string)x.Element("pubDate"))
                });
                model.RSSFeeds = RSSFeedData.ToList();
                if (sub.FirstOrDefault().LastPublishedDate != subscription.LastPublishedDate)
                {
                    subscription.LastPublishedDate = sub.FirstOrDefault().LastPublishedDate;
                    if (_subscriptionRepo.Update(subscription))
                    {
                        foreach (var item in model.RSSFeeds)
                        {
                            Post post = new Post();
                            post.Author         = item.Author;
                            post.Body           = item.Description;
                            post.SubscriptionId = id;
                            post.PostDate       = DateTime.Parse(item.PubDate);
                            post.Link           = item.Link;
                            post.Title          = item.Title;
                            post.CreatedBy      = currentUserId;
                            _postRepo.Insert(post);
                        }
                    }
                }
                return(PartialView(model));
            }
            catch (Exception ex)
            {
                TempData["Error"] = ex.Message;
                model             = new FeedViewModel();

                return(PartialView(model));
            }
        }
        public IActionResult PartiallyUpdateSubscription(string id, [FromBody] JsonPatchDocument <Subscription> jsonPatch)
        {
            Subscription toPatch = subRepo.GetSingle(subRepo.guidColumnName, id);

            jsonPatch.ApplyTo(toPatch, ModelState);
            TryValidateModel(ModelState);
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var model = new {
                patchedUser     = toPatch,
                patchOperations = jsonPatch
            };

            if (jsonPatch.Operations.Count > 1)
            {
                if (!subRepo.Update(toPatch, this.subRepo.guidColumnName, id))
                {
                    return(new StatusCodeResult(500));
                }
            }
            else
            {
                string column = jsonPatch.Operations.Single().path.Substring(1);
                string value  = jsonPatch.Operations.Single().value.ToString();
                if (!subRepo.Update(column, value, this.subRepo.guidColumnName, id))
                {
                    return(new StatusCodeResult(500));
                }
            }

            /*
             * How to send patch from body
             * [
             * {
             * "op": "replace",
             * "path": "/<property name>",
             * "value": "<property value>"
             * },
             * {
             * "op": "replace",
             * "path": "/<property name>",
             * "value": "<property value>"
             * },
             * ]
             */
            return(Ok(model));
        }