コード例 #1
0
        private void btnRemoveSubject_Click(object sender, EventArgs e)
        {
            int courseSubjectID = (int)dgvListCourseSubject.CurrentRow.Cells["CourseSubjectID"].Value;

            _courseSubjectService.Delete(new CourseSubject {
                CourseSubjectID = courseSubjectID
            });
            PopulateGridCourseSubjects();
        }
コード例 #2
0
        public async Task <IActionResult> SubjectDelete(string id)
        {
            var subject = await _courseSubjectService.GetById(id);

            if (subject == null)
            {
                throw new ArgumentException("No subject found with the specified id");
            }

            await _courseSubjectService.Delete(subject);

            return(new NullJsonResult());
        }