public async Task <VaccineDto> GetVaccineAsync(int id) { Vaccine vaccine = await _vaccineRepo.GetAsync(id); VaccineDto result = _mapper.Map <VaccineDto>(vaccine); return(result); }
public async Task AddAppointmentAsync(int userId, int vaccineId) { Vaccine vaccine = await _vaccineRepo.GetAsync(vaccineId); DateTime date = await _dateService.GetAppointmentDateAsync(userId); VaccinationCenter center = await _dateService.GetVaccinationCenterAsync(userId); Appointment appointment = new Appointment { Vaccination = vaccine, UserId = userId, Date = date, LocationId = center.Id, StatusId = 1 }; await _appointmentRepo.AddAsync(appointment); }