public async Task Edit(StudentSubjectProjectInput input)
        {
            //检查Id参数
            if (!input.Id.HasValue)
            {
                throw new UserFriendlyException("传入Id参数不正确!");
            }

            //验证
            var course = await _studentSubjectProjectRepository.FirstOrDefaultAsync(x => x.Id == input.CourseId);

            if (course == null)
            {
                throw new UserFriendlyException($"编号为{input.CourseId}的课程不存在!");
            }

            //获取需要修改的对象
            var studentSubjectProject = await _studentSubjectProjectRepository.FirstOrDefaultAsync(x => x.Id == input.Id.Value);

            if (studentSubjectProject == null)
            {
                throw new UserFriendlyException("当前课程不存在!");
            }

            //修改属性值
            if (input.CourseId.HasValue)
            {
                studentSubjectProject.CourseId = input.CourseId.Value;
            }
            if (input.StudentId.HasValue)
            {
                studentSubjectProject.StudentId = input.StudentId.Value;
            }
            //课堂成绩属性赋值
            if (input.ClassCredit.HasValue)
            {
                studentSubjectProject.ClassCredit = input.ClassCredit.Value;
            }
            //考核成绩属性赋值
            if (input.ExamCredit.HasValue)
            {
                studentSubjectProject.ExamCredit = input.ExamCredit.Value;
            }
            // 总成绩属性赋值
            if (input.TotalCadit.HasValue)
            {
                studentSubjectProject.TotalCadit = input.TotalCadit.Value;
            }

            //执行修改数据方法
            await _studentSubjectProjectRepository.UpdateAsync(studentSubjectProject);
        }
        public async Task Add(StudentSubjectProjectInput input)
        {
            //检查Id参数
            if (!input.CourseId.HasValue)
            {
                throw new UserFriendlyException("传入CourseId参数不正确!");
            }
            if (!input.StudentId.HasValue)
            {
                throw new UserFriendlyException("传入StudentId参数不正确!");
            }

            //验证学生项目所属项目是否存在
            var subject = await _studentSubjectProjectRepository.FirstOrDefaultAsync(x => x.Id == input.CourseId);

            if (subject == null)
            {
                throw new UserFriendlyException($"编号为{input.CourseId}的项目不存在!");
            }

            //创建学生项目对象
            var studentSubjectProject = new Education.StudentSubjectProject
            {
                CourseId  = input.CourseId.Value,
                StudentId = input.StudentId.Value
            };

            //课堂成绩属性赋值
            if (input.ClassCredit.HasValue)
            {
                studentSubjectProject.ClassCredit = input.ClassCredit.Value;
            }
            //考核成绩属性赋值
            if (input.ExamCredit.HasValue)
            {
                studentSubjectProject.ExamCredit = input.ExamCredit.Value;
            }
            // 总成绩属性赋值
            if (input.TotalCadit.HasValue)
            {
                studentSubjectProject.TotalCadit = input.TotalCadit.Value;
            }

            await _studentSubjectProjectRepository.InsertAsync(studentSubjectProject);
        }