コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            var student = _studentApp.GetById(id);

            _studentApp.Remove(student);

            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public IActionResult Delete(Guid?id)
 {
     if (id == null)
     {
         return(NotFound());
     }
     studentAppService.Remove(id.Value);
     return(Json("delete success"));
 }
コード例 #3
0
ファイル: StudentController.cs プロジェクト: outman000/DDD
        public IActionResult DeleteConfirmed(Guid id)
        {
            _studentAppService.Remove(id);

            if (!_notifications.HasNotifications())
            {
                return(View(_studentAppService.GetById(id)));
            }

            ViewBag.Sucesso = "Student Removed!";
            return(RedirectToAction("Index"));
        }
コード例 #4
0
        public IActionResult Remove([FromQuery] Guid Id)
        {
            _command = new RemoveStudentCommand(Id);
            if (!_command.IsVaild())
            {
                List <string> _err = new List <string>();
                foreach (var err in _command.ValidationResult.Errors)
                {
                    _err.Add(err.ErrorMessage);
                }

                return(Ok(_err));
            }

            _sevice.Remove(Id);
            return(Ok());
        }
コード例 #5
0
        public ActionResult DeleteConfirmed(Guid id)
        {
            studentAppService.Remove(id);

            return(RedirectToAction("Index"));
        }