public async Task <IActionResult> Details()
        {
            var doctor = await _doctorRepository.GetDoctorByUserEmail(this.User.Identity.Name);

            if (doctor == null || doctor.IsDeleted)
            {
                return(NotFound());
            }

            doctor.User = await _userRepository.GetUserByEmailAsync(this.User.Identity.Name);

            if (doctor.User == null || doctor.User.IsDeleted)
            {
                return(NotFound());
            }

            doctor.Room = await _specialityRepository.GetRoomByIdAsync(doctor.RoomId);

            if (doctor.Room == null)
            {
                return(NotFound());
            }

            doctor.Room.Speciality = await _specialityRepository.GetSpecialityAsync(doctor.Room);

            if (doctor.Room.Speciality == null)
            {
                return(NotFound());
            }


            var model = _converterHelper.ToDoctorDetailsViewModel(doctor);

            return(View(model));
        }
        public async Task <IActionResult> EditRoom(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var room = await _specialityRepository.GetRoomByIdAsync(id.Value);

            if (room == null)
            {
                return(NotFound());
            }


            var model = _converterHelper.ToEditRoomViewModel(room);

            return(View(model));
        }