public async Task AddMedicalAppointmentAsync(MedicalAppointmentDto medicalAppointment) { var request = new HttpRequestMessage(HttpMethod.Post, $"https://localhost:44381/AddAppointment"); request.Headers.Add("Accept", "application/json"); var options = new JsonSerializerOptions { PropertyNameCaseInsensitive = true, }; var jsonString = JsonSerializer.Serialize(medicalAppointment, options); var content = new StringContent(jsonString, Encoding.UTF8, "application/json"); request.Content = content; var client = clientFactory.CreateClient(); var response = await client.SendAsync(request); using var responseStream = await response.Content.ReadAsStreamAsync(); }
public async Task AddMedicalAppointmentAsync(MedicalAppointmentDto appointmentDto) { await medicalAppointmentServiceClient.AddMedicalAppointmentAsync(appointmentDto); }
public async Task AddNewAppointment([FromBody] MedicalAppointmentDto appointmentDto) { await doctorsHandler.AddMedicalAppointmentAsync(appointmentDto); }