예제 #1
0
        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();
            }
        }
예제 #2
0
 public ActionResult Delete(int id, ArticleCommentRateModel articleCommentRate)
 {
     _articleCommentRateRepository.Delete(id);
     return(RedirectToAction(nameof(Index)));
 }
예제 #3
0
 public ActionResult Create(ArticleCommentRateModel articleCommentRate)
 {
     _articleCommentRateRepository.Add(articleCommentRate);
     return(RedirectToAction(nameof(Index)));
 }
예제 #4
0
 public void Add(ArticleCommentRateModel articleCommentRate)
 {
     _context.ArticleCommentRates.Add(articleCommentRate);
     _context.SaveChanges();
 }