public SubmissionModel Map(SubmissionDTO submissionDTO) { if (submissionDTO == null) { return(null); } submissionDTO.Student = _iStudentMapper.Map(_iStudentService.GetById(submissionDTO.StudentId)); submissionDTO.Assignment = _iAssignmentMapper.Map(_iAssignmentService.GetById(submissionDTO.AssignmentId)); var studentModel = _iStudentMapper.Map(submissionDTO.Student); var assigModel = _iAssignmentMapper.Map(submissionDTO.Assignment); return(new SubmissionModel { Id = submissionDTO.Id, StudentId = studentModel.Id, Student = studentModel, AssignmentId = assigModel.Id, Assignment = assigModel, Link = submissionDTO.Link, Remark = submissionDTO.Remark, Grade = submissionDTO.Grade }); }
public void AddAssignment(AssignmentModel assignmentModel) { var assign = _iAssignmentMapper.Map(assignmentModel); _iAssignmentRepository.Add(assign); _iAssignmentRepository.SaveChanges(); }
public void Add(AssignmentModel assignmentModel) { aRepo.Add(aMapper.Map(assignmentModel)); }