Exemple #1
0
        public async Task <ActionResult> GetAllAppointments()
        {
            var query  = new GetAllAppointmentsQuery();
            var result = await Mediator.Send(query);

            return(Ok(result));
        }
        public async Task <List <ViewAppointmentQueryDto> > Handle(GetAllAppointmentsQuery request, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            return((await uow.Appointments.GetAll()).Select(s => new ViewAppointmentQueryDto
            {
                Id = s.Id,
                Name = s.AppointmentName,
                Description = s.Description
            }).ToList());
        }
        public async Task <List <AppointmentHasTechnicianDTO> > Handle(GetAllAppointmentsQuery request, CancellationToken cancellationToken)
        {
            List <Domain.Model.Soporte.AppointmentHasTechnician> appointmentHasTechnicians = await _appointmentRepository.GetAppointments();

            List <AppointmentHasTechnicianDTO> appointmentDTOs = new List <AppointmentHasTechnicianDTO>();

            foreach (var item in appointmentHasTechnicians)
            {
                appointmentDTOs.Add(
                    new AppointmentHasTechnicianDTO(
                        item.AppoinmtentHasTechnicianId,
                        item.Appointment, item.Technician
                        )
                    );
            }
            return(appointmentDTOs);
        }
        public async Task <IEnumerable <AppointmentModel> > Handle(GetAllAppointmentsQuery request, CancellationToken cancellationToken)
        {
            var appointments = await _repository.GetAppointmentsAsync();

            return(appointments.Select(a => new AppointmentModel()
            {
                Id = a.Id,
                DateAt = a.DateAt,
                Description = a.Description,
                Completed = a.Completed,
                Specialist = new SpecialistModel()
                {
                    Id = a.Specialist.Id,
                    Names = a.Specialist.Names,
                    Surnames = a.Specialist.Surnames
                },
                Patient = new PatientModel()
                {
                    Id = a.Patient.Id,
                    Names = a.Patient.Names,
                    Surnames = a.Patient.Surnames
                }
            }));
        }
 public Task <IReadOnlyList <AppointmentListingsOutputModel> > Handle(GetAllAppointmentsQuery request, CancellationToken cancellationToken)
 => this.appointmentRepository.GetAllList(this.currentUser.UserId, cancellationToken);
        public async Task <List <AppointmentDto> > Handle(GetAllAppointmentsQuery request, CancellationToken cancellationToken)
        {
            var appointments = await _dbContext.Appointments.ProjectTo <AppointmentDto>(_mapper.ConfigurationProvider).ToListAsync();

            return(appointments);
        }