public async Task <ProfessorDetailsDto> Create(ProfessorCreatingDto newProfessor)
        {
            Domain.Entities.Professor professor = this.professorMapper.Map(newProfessor);
            await this.writeRepository.AddNewAsync(professor);

            await this.writeRepository.SaveAsync();

            return(this.professorMapper.Map(professor));
        }
        public async Task <ProfessorDetailsDto> Update(Guid existingProfessorId, ProfessorCreatingDto professorCreatingDto)
        {
            ProfessorDetailsDto professorDetailsDto = this.professorMapper.Map(existingProfessorId, professorCreatingDto);
            var professor = GetProfessorById(existingProfessorId).Result;

            this.writeRepository.Update(this.professorMapper.Map(professorDetailsDto, professor));
            await this.writeRepository.SaveAsync();

            return(professorDetailsDto);
        }
 public Domain.Entities.Professor Map(ProfessorCreatingDto professorCreatingDto)
 {
     Domain.Entities.Professor professor = new Domain.Entities.Professor(
         professorCreatingDto.RegistrationNumber,
         professorCreatingDto.Email,
         professorCreatingDto.Password,
         professorCreatingDto.FirstName,
         professorCreatingDto.LastName);
     return(professor);
 }
        public ProfessorDetailsDto Map(Guid professorId, ProfessorCreatingDto professorCreatingDto)
        {
            ProfessorDetailsDto professorDetailsDto = new ProfessorDetailsDto
            {
                Id = professorId,
                RegistrationNumber = professorCreatingDto.RegistrationNumber,
                Email     = professorCreatingDto.Email,
                Password  = professorCreatingDto.Password,
                FirstName = professorCreatingDto.FirstName,
                LastName  = professorCreatingDto.LastName
            };

            return(professorDetailsDto);
        }