コード例 #1
0
        public async Task <IActionResult> Delete(long Id)
        {
            var result = await _instructorService.DeleteInstructor(Id);

            var response = new APIResponse <bool>(result);

            return(Ok(response));
        }
コード例 #2
0
        public IHttpActionResult DeleteInstructor([FromUri] int instructorId, [FromUri] long groupId)
        {
            var instructorGroup = new InstructorGroupEntity
            {
                GroupId      = groupId,
                InstructorId = instructorId
            };

            instructorService.DeleteInstructor(instructorGroup);
            return(Ok());
        }
コード例 #3
0
        public IActionResult DeleteInstructor([FromQuery] int instructorId)
        {
            try
            {
                _instructorService.DeleteInstructor(instructorId);

                return(Ok());
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
コード例 #4
0
        public IActionResult DeleteInstructor(int id)
        {
            try
            {
                _instructorService.DeleteInstructor(id);

                ViewData["Message"] = "Instructor Deleted";
                return(View("Message"));
            }
            catch (Exception e)
            {
                ViewData["Message"] = e.Message;
                return(View("Message"));
            }
        }
コード例 #5
0
        public ActionResult DeleteConfirmed(int id)
        {
            _instructorService.DeleteInstructor(id);

            return(RedirectToAction("Index"));
        }