private async Task SaveAppointment()
        {
            if (IsValid())
            {
                if (Appointment.AppointmentId == Guid.Empty)
                {
                    CreateAppointmentRequest toCreate = new CreateAppointmentRequest()
                    {
                        Details           = Title,
                        SelectedDoctor    = (int)Appointment.DoctorId,
                        PatientId         = Patient.PatientId,
                        ClientId          = Patient.ClientId,
                        ScheduleId        = ScheduleId,
                        RoomId            = Appointment.RoomId,
                        AppointmentTypeId = Appointment.AppointmentTypeId,
                        DateOfAppointment = Appointment.Start.DateTime,
                    };

                    await AppointmentService.CreateAsync(toCreate);
                }
                else
                {
                    var toUpdate = UpdateAppointmentRequest.FromDto(Appointment);
                    await AppointmentService.EditAsync(toUpdate);
                }

                await OnAppointmentChanged.InvokeAsync(Appointment.Title);
            }
        }
 private Task CancelEditing()
 {
     return(OnAppointmentChanged.InvokeAsync(Appointment.Title));
 }
        private async Task DeleteAppointment()
        {
            await AppointmentService.DeleteAsync(Appointment.AppointmentId);

            await OnAppointmentChanged.InvokeAsync(Appointment.Title);
        }