Пример #1
0
        public ActionResult Edit(CommentViewModel comment)
        {
            if (ModelState.IsValid)
            {
                var commentDomain = Mapper.Map <CommentViewModel, Comment>(comment);
                _commentApp.Update(commentDomain);

                return(RedirectToAction("Index"));
            }

            return(View(comment));
        }
Пример #2
0
        public IActionResult Update([FromBody] CommentUpdate input)
        {
            var a = _commentAppService.GetById(input.Id);

            if (a == null)
            {
                throw new Exception("Không tồn tại comment để update");
            }
            else
            {
                var cmt = _commentAppService.Update(input);
                return(Ok());
            }
        }