public ActionResult WxDetail(int id) { if (string.IsNullOrEmpty(ViewBag.LillyId)) { return(Redirect("/notauthed.html")); } var article = _objService.GetArticleFromCache(id); article.ReadCount++; //_objService.Repository.Update(article, new List<string> { "ReadCount" }); _objService.BackendUpdateReadCount(article.Id); var list = _articleThumbsUpService.Repository.Entities.Where(x => x.ArticleID == id && x.Type == ThumbupType.Article.ToString()).Select(x => new { articleId = x.ArticleID, userId = x.UserID, x.IsDeleted }).ToList(); if (list.Any()) { article.ThumbsUpCount = list.Count(x => x.IsDeleted != true); } if (article == null || article.ArticleStatus != ConstData.STATUS_PUBLISH || article.IsDeleted.Value) { return(Redirect("../invalid")); } ExecuteBehavior(article.AppId.Value, 1, "", id.ToString()); if (!string.IsNullOrEmpty(article.ArticleURL)) { if (!article.IsPassingLillyID.GetValueOrDefault()) { return(Redirect(article.ArticleURL)); } var builder = new UriBuilder(article.ArticleURL); var query = HttpUtility.ParseQueryString(builder.Query); query.Add("lillyId", _objService.EncryptorLillyid(ViewBag.LillyId)); _Logger.Debug(string.Format("url {0}", builder.ToString())); builder.Query = query.ToString(); return(Redirect(builder.ToString())); } var articleView = new ArticleInfoView().ConvertAPIModel(article); var view = (ArticleInfoView)articleView; view.IsThumbuped = list.Any(x => x.userId == ViewBag.LillyId && x.IsDeleted != true); return(View(view)); }