public void Update(int articleCommentRateId, ArticleCommentRateModel articleCommentRate) { var result = _context.ArticleCommentRates.SingleOrDefault(x => x.ArticleCommentRateId == articleCommentRateId); if (result != null) { result.Value = articleCommentRate.Value; _context.SaveChanges(); } }
public ActionResult Delete(int id, ArticleCommentRateModel articleCommentRate) { _articleCommentRateRepository.Delete(id); return(RedirectToAction(nameof(Index))); }
public ActionResult Create(ArticleCommentRateModel articleCommentRate) { _articleCommentRateRepository.Add(articleCommentRate); return(RedirectToAction(nameof(Index))); }
public void Add(ArticleCommentRateModel articleCommentRate) { _context.ArticleCommentRates.Add(articleCommentRate); _context.SaveChanges(); }