Ejemplo n.º 1
0
        public SubmissionModel Map(SubmissionAPIModel submissionAPIModel)
        {
            if (submissionAPIModel == null)
            {
                return(null);
            }

            var studentModel = _iStudentAPIMapper.Map(submissionAPIModel.Student);
            var assignModel  = _iAssignmentAPIMapper.Map(submissionAPIModel.Assignment);

            var att = new SubmissionModel();

            att.Assignment = assignModel;
            att.Grade      = submissionAPIModel.Grade;
            att.Link       = submissionAPIModel.Link;
            att.Remark     = submissionAPIModel.Remark;
            att.Student    = studentModel;
            return(att);

            //return new SubmissionModel
            //{
            //    SubmissionStatus = Submission,
            //    Student = studentModel,
            //    Assignment = labModel
            //};

            //SubmissionModel SubmissionModel = new SubmissionModel(Submission, studentModel, labModel);

            //return SubmissionModel;
        }
Ejemplo n.º 2
0
        public SubmissionAPIShortModel Map(SubmissionAPIModel submissionAPIModel)
        {
            if (submissionAPIModel == null)
            {
                return(null);
            }

            return(new SubmissionAPIShortModel
            {
                AssignmentName = submissionAPIModel.Assignment.Name,
                Grade = submissionAPIModel.Grade,
                Link = submissionAPIModel.Link,
                Remark = submissionAPIModel.Remark,
                StudentUsername = submissionAPIModel.Student.Username
            });
        }