コード例 #1
0
        public async Task <StudentDetailsDto> Update(Guid id, StudentCreationDto studentCreationDto)
        {
            StudentDetailsDto studentDetailsDto = studentMapper.Map(id, studentCreationDto);
            var student = GetStudentById(id).Result;

            writeRepository.Update(studentMapper.Map(studentDetailsDto, student));
            await writeRepository.SaveAsync();

            return(studentDetailsDto);
        }
コード例 #2
0
        public StudentDetailsDto Map(Guid id, StudentCreationDto studentCreationDto)
        {
            StudentDetailsDto studentDetailsDto = new StudentDetailsDto
            {
                Id                 = id,
                FirstName          = studentCreationDto.FirstName,
                LastName           = studentCreationDto.LastName,
                Email              = studentCreationDto.Email,
                RegistrationNumber = studentCreationDto.RegistrationNumber,
                YearOfStudy        = studentCreationDto.YearOfStudy,
                Password           = studentCreationDto.Password
            };

            return(studentDetailsDto);
        }
コード例 #3
0
        public StudentDetailsDto Map(Domain.Entities.Student student)
        {
            StudentDetailsDto studentDetailsDto = new StudentDetailsDto
            {
                Id                 = student.Id,
                FirstName          = student.FirstName,
                LastName           = student.LastName,
                Email              = student.Email,
                RegistrationNumber = student.RegistrationNumber,
                YearOfStudy        = student.YearOfStudy,
                Password           = student.Password
            };

            return(studentDetailsDto);
        }
コード例 #4
0
 public Domain.Entities.Student Map(StudentDetailsDto studentDetails, Domain.Entities.Student student)
 {
     autoMapper.Map(studentDetails, student);
     return(student);
 }