public async Task AddPrescriptionAsync(AddPrescriptionDto prescriptionDto) { var request = new HttpRequestMessage(HttpMethod.Post, $"https://localhost:44381/add-prescription"); request.Headers.Add("Accept", "application/json"); var options = new JsonSerializerOptions { PropertyNameCaseInsensitive = true, }; var jsonString = JsonSerializer.Serialize(prescriptionDto, 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 AddPrescriptionAsync(AddPrescriptionDto prescriptionDto) { await prescriptionServiceClient.AddPrescriptionAsync(prescriptionDto); }
public async Task AddNewPrescription([FromBody] AddPrescriptionDto prescriptionDto) { await doctorsHandler.AddPrescriptionAsync(prescriptionDto); }