What Brandon said - you need this when you call the repository function.
var appointment = _appointmentRepository.GetAppointmentDetails(appointmentId.Value);
Guid?
and Guid
are totally different types; GetAppointmentDetails
requires Guid
.