From 6a9e0699204ee26aaf12b983770b6aef82cd0450 Mon Sep 17 00:00:00 2001 From: Bright Date: Thu, 15 Aug 2024 16:01:23 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1?= =?UTF-8?q?=20Header?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Commands/CommandRepository.cs | 98 +++++++++++++++++++ .../Repositories/GenericRepository.cs | 10 +- .../LeaveRequests/LeaveRequestRepository.cs | 1 + .../MessageQueue/InboxRepository.cs | 1 + .../MessageQueue/NotificationRepository.cs | 2 + .../Reports/ProbationReportRepository.cs | 5 + .../DisciplineComplaint_AppealController.cs | 2 + .../Controllers/DisciplineResultController.cs | 5 + .../Controllers/NotifyController.cs | 2 + .../PlacementAppointmentController.cs | 2 + .../PlacementAppointmentEmployeeController.cs | 2 + .../Controllers/PlacementController.cs | 4 + .../Controllers/PlacementOfficerController.cs | 3 + .../Controllers/PlacementReceiveController.cs | 2 + .../PlacementRepatriationController.cs | 2 + .../PlacementTransferController.cs | 3 + .../Controllers/RetirementController.cs | 2 + .../RetirementDeceasedController.cs | 4 + .../Controllers/RetirementOtherController.cs | 2 + .../Controllers/RetirementOutController.cs | 2 + .../Controllers/RetirementResignController.cs | 2 + 21 files changed, 154 insertions(+), 2 deletions(-) diff --git a/BMA.EHR.Application/Repositories/Commands/CommandRepository.cs b/BMA.EHR.Application/Repositories/Commands/CommandRepository.cs index efd045fc..e6b74472 100644 --- a/BMA.EHR.Application/Repositories/Commands/CommandRepository.cs +++ b/BMA.EHR.Application/Repositories/Commands/CommandRepository.cs @@ -919,6 +919,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var res = await client.SendAsync(req); var result = await res.Content.ReadAsStringAsync(); @@ -933,6 +934,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var _client = new HttpClient()) { _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + _client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl); var _res = await _client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -984,6 +986,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var res = await client.SendAsync(req); var result = await res.Content.ReadAsStringAsync(); @@ -998,6 +1001,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var _client = new HttpClient()) { _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + _client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl); var _res = await _client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -1419,6 +1423,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var res = await client.SendAsync(req); var result = await res.Content.ReadAsStringAsync(); @@ -1435,6 +1440,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var _client = new HttpClient()) { _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + _client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl); var _res = await _client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -1528,6 +1534,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var res = await client.SendAsync(req); var result = await res.Content.ReadAsStringAsync(); @@ -1543,6 +1550,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var _client = new HttpClient()) { _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + _client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl); var _res = await _client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -1595,6 +1603,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var res = await client.SendAsync(req); var result = await res.Content.ReadAsStringAsync(); @@ -1823,6 +1832,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var res = await client.SendAsync(req); var result = await res.Content.ReadAsStringAsync(); @@ -1839,6 +1849,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var _client = new HttpClient()) { _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + _client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl); var _res = await _client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -1894,6 +1905,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var res = await client.SendAsync(req); var result = await res.Content.ReadAsStringAsync(); @@ -1910,6 +1922,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var _client = new HttpClient()) { _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + _client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl); var _res = await _client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -1965,6 +1978,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var res = await client.SendAsync(req); var result = await res.Content.ReadAsStringAsync(); @@ -1981,6 +1995,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var _client = new HttpClient()) { _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + _client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl); var _res = await _client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -2036,6 +2051,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var res = await client.SendAsync(req); var result = await res.Content.ReadAsStringAsync(); @@ -2052,6 +2068,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var _client = new HttpClient()) { _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + _client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl); var _res = await _client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -2107,6 +2124,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var res = await client.SendAsync(req); var result = await res.Content.ReadAsStringAsync(); @@ -2123,6 +2141,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var _client = new HttpClient()) { _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + _client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl); var _res = await _client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -2178,6 +2197,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var res = await client.SendAsync(req); var result = await res.Content.ReadAsStringAsync(); @@ -2194,6 +2214,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var _client = new HttpClient()) { _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + _client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl); var _res = await _client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -2249,6 +2270,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var res = await client.SendAsync(req); var result = await res.Content.ReadAsStringAsync(); @@ -2265,6 +2287,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var _client = new HttpClient()) { _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + _client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl); var _res = await _client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -2317,6 +2340,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var res = await client.SendAsync(req); var result = await res.Content.ReadAsStringAsync(); @@ -2331,6 +2355,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var _client = new HttpClient()) { _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + _client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl); var _res = await _client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -2384,6 +2409,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var res = await client.SendAsync(req); var result = await res.Content.ReadAsStringAsync(); @@ -2436,6 +2462,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var res = await client.SendAsync(req); var result = await res.Content.ReadAsStringAsync(); @@ -2488,6 +2515,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var res = await client.SendAsync(req); var result = await res.Content.ReadAsStringAsync(); @@ -2540,6 +2568,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var res = await client.SendAsync(req); var result = await res.Content.ReadAsStringAsync(); @@ -2592,6 +2621,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var res = await client.SendAsync(req); var result = await res.Content.ReadAsStringAsync(); @@ -2643,6 +2673,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var res = await client.SendAsync(req); var result = await res.Content.ReadAsStringAsync(); @@ -2694,6 +2725,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var res = await client.SendAsync(req); var result = await res.Content.ReadAsStringAsync(); @@ -2991,6 +3023,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var _res = await client.PostAsJsonAsync(apiUrl, new { @@ -3042,6 +3075,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); foreach (var edu in placementProfile.PlacementEducations) { var _res = await client.PostAsJsonAsync(apiUrlEdu, new @@ -3078,6 +3112,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); foreach (var cer in placementProfile.PlacementCertificates) { var _res = await client.PostAsJsonAsync(apiUrlCer, new @@ -3098,6 +3133,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _res = await client.PostAsJsonAsync(apiUrlSalary, new { profileId = profileId, @@ -3128,6 +3164,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg); var _res = await client.PostAsJsonAsync(apiUrlOrg, new { @@ -3279,6 +3316,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _res = await client.PostAsJsonAsync(apiUrlSalary, new { @@ -3310,6 +3348,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg); var _res = await client.PostAsJsonAsync(apiUrlOrg, new { @@ -3458,6 +3497,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _res = await client.PostAsJsonAsync(apiUrlSalary, new { @@ -3489,6 +3529,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg); var _res = await client.PostAsJsonAsync(apiUrlOrg, new { @@ -3637,6 +3678,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _res = await client.PostAsJsonAsync(apiUrlSalary, new { @@ -3668,6 +3710,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg); var _res = await client.PostAsJsonAsync(apiUrlOrg, new { @@ -3818,6 +3861,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _res = await client.PostAsJsonAsync(apiUrlSalary, new { @@ -3849,6 +3893,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg); var _res = await client.PostAsJsonAsync(apiUrlOrg, new { @@ -4001,6 +4046,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _res = await client.PostAsJsonAsync(apiUrlSalary, new { @@ -4032,6 +4078,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg); var _res = await client.PostAsJsonAsync(apiUrlOrg, new { @@ -4181,6 +4228,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _res = await client.PostAsJsonAsync(apiUrlSalary, new { @@ -4212,6 +4260,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg); var _res = await client.PostAsJsonAsync(apiUrlOrg, new { @@ -4362,6 +4411,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _res = await client.PostAsJsonAsync(apiUrlSalary, new { @@ -4388,6 +4438,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlLeave); string? _null = null; var _res = await client.PostAsJsonAsync(apiUrlLeave, new @@ -4538,6 +4589,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _res = await client.PostAsJsonAsync(apiUrlSalary, new { @@ -4564,6 +4616,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlLeave); string? _null = null; var _res = await client.PostAsJsonAsync(apiUrlLeave, new @@ -4904,6 +4957,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var _res = await client.PostAsJsonAsync(apiUrl, new { @@ -5060,6 +5114,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var _res = await client.PostAsJsonAsync(apiUrl, new { @@ -5236,6 +5291,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _res = await client.PostAsJsonAsync(apiUrlSalary, new { @@ -5413,6 +5469,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _res = await client.PostAsJsonAsync(apiUrlSalary, new { @@ -5444,6 +5501,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg); var _res = await client.PostAsJsonAsync(apiUrlOrg, new { @@ -5597,6 +5655,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _res = await client.PostAsJsonAsync(apiUrlSalary, new { @@ -5775,6 +5834,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _res = await client.PostAsJsonAsync(apiUrlSalary, new { @@ -5955,6 +6015,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var _res = await client.PostAsJsonAsync(apiUrl, new { @@ -5969,6 +6030,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _res = await client.PostAsJsonAsync(apiUrlSalary, new { @@ -6149,6 +6211,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var _res = await client.PostAsJsonAsync(apiUrl, new { @@ -6163,6 +6226,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _res = await client.PostAsJsonAsync(apiUrlSalary, new { @@ -6336,6 +6400,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var _res = await client.PostAsJsonAsync(apiUrl, new { @@ -6416,6 +6481,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Post, _apiUrl); var res = await client.PostAsJsonAsync(_apiUrl, new { result = dataSend }); var result = await res.Content.ReadAsStringAsync(); @@ -6512,6 +6578,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var _res = await client.PostAsJsonAsync(apiUrl, new { @@ -6592,6 +6659,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Post, _apiUrl); var res = await client.PostAsJsonAsync(_apiUrl, new { result = dataSend }); var result = await res.Content.ReadAsStringAsync(); @@ -6680,6 +6748,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var res = await client.PostAsJsonAsync(apiUrl, new { result = data }); var result = await res.Content.ReadAsStringAsync(); @@ -6837,6 +6906,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _res = await client.PostAsJsonAsync(apiUrlSalary, new { @@ -6865,6 +6935,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg); var _res = await client.PostAsJsonAsync(apiUrlOrg, new { @@ -7020,6 +7091,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Put, apiUrl); var _res = await client.PutAsJsonAsync(apiUrl, new { @@ -7172,6 +7244,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _res = await client.PostAsJsonAsync(apiUrlSalary, new { @@ -7200,6 +7273,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg); var _res = await client.PostAsJsonAsync(apiUrlOrg, new { @@ -7340,6 +7414,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var res = await client.PostAsJsonAsync(apiUrl, new { result = data }); var result = await res.Content.ReadAsStringAsync(); @@ -7365,6 +7440,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2); var _res = await client.PostAsJsonAsync(apiUrl2, new { @@ -7497,6 +7573,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var res = await client.PostAsJsonAsync(apiUrl, new { result = data }); var result = await res.Content.ReadAsStringAsync(); @@ -7522,6 +7599,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2); var _res = await client.PostAsJsonAsync(apiUrl2, new { @@ -7655,6 +7733,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var res = await client.PostAsJsonAsync(apiUrl, new { result = data }); var result = await res.Content.ReadAsStringAsync(); @@ -7680,6 +7759,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2); var _res = await client.PostAsJsonAsync(apiUrl2, new { @@ -7813,6 +7893,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var res = await client.PostAsJsonAsync(apiUrl, new { result = data }); var result = await res.Content.ReadAsStringAsync(); @@ -7838,6 +7919,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2); var _res = await client.PostAsJsonAsync(apiUrl2, new { @@ -7971,6 +8053,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var res = await client.PostAsJsonAsync(apiUrl, new { result = data }); var result = await res.Content.ReadAsStringAsync(); @@ -7996,6 +8079,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2); var _res = await client.PostAsJsonAsync(apiUrl2, new { @@ -8129,6 +8213,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var res = await client.PostAsJsonAsync(apiUrl, new { result = data }); var result = await res.Content.ReadAsStringAsync(); @@ -8154,6 +8239,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2); var _res = await client.PostAsJsonAsync(apiUrl2, new { @@ -8287,6 +8373,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var res = await client.PostAsJsonAsync(apiUrl, new { result = data }); var result = await res.Content.ReadAsStringAsync(); @@ -8312,6 +8399,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2); var _res = await client.PostAsJsonAsync(apiUrl2, new { @@ -8445,6 +8533,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var res = await client.PostAsJsonAsync(apiUrl, new { result = data }); var result = await res.Content.ReadAsStringAsync(); @@ -8470,6 +8559,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2); var _res = await client.PostAsJsonAsync(apiUrl2, new { @@ -8602,6 +8692,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var res = await client.PostAsJsonAsync(apiUrl, new { result = data }); var result = await res.Content.ReadAsStringAsync(); @@ -8744,6 +8835,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var res = await client.PostAsJsonAsync(apiUrl, new { result = data }); var result = await res.Content.ReadAsStringAsync(); @@ -8886,6 +8978,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var res = await client.PostAsJsonAsync(apiUrl, new { result = data }); var result = await res.Content.ReadAsStringAsync(); @@ -9027,6 +9120,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var res = await client.PostAsJsonAsync(apiUrl, new { result = data }); var result = await res.Content.ReadAsStringAsync(); @@ -9169,6 +9263,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var res = await client.PostAsJsonAsync(apiUrl, new { result = data }); var result = await res.Content.ReadAsStringAsync(); @@ -9546,6 +9641,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); string? _null = null; var _res = await client.PostAsJsonAsync(apiUrl, new @@ -9561,6 +9657,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _res = await client.PostAsJsonAsync(apiUrlSalary, new { @@ -11341,6 +11438,7 @@ namespace BMA.EHR.Application.Repositories.Commands using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); foreach (var insignia in Insignias) { var _res = await client.PostAsJsonAsync(apiUrlInsig, new diff --git a/BMA.EHR.Application/Repositories/GenericRepository.cs b/BMA.EHR.Application/Repositories/GenericRepository.cs index 9a21b29f..cdf4ef4b 100644 --- a/BMA.EHR.Application/Repositories/GenericRepository.cs +++ b/BMA.EHR.Application/Repositories/GenericRepository.cs @@ -9,6 +9,7 @@ using Newtonsoft.Json; using System.Net.Http.Headers; using System.Security.Claims; using System.Text; +using Microsoft.Extensions.Configuration; namespace BMA.EHR.Application.Repositories { @@ -19,18 +20,20 @@ namespace BMA.EHR.Application.Repositories private readonly IApplicationDBContext _dbContext; private readonly DbSet _dbSet; private readonly IHttpContextAccessor _httpContextAccessor; + private readonly IConfiguration _configuration; #endregion #region " Constructor and Destructor " public GenericRepository(IApplicationDBContext dbContext, - IHttpContextAccessor httpContextAccessor) + IHttpContextAccessor httpContextAccessor, + IConfiguration configuration) { _dbContext = dbContext; _dbSet = _dbContext.Set(); _httpContextAccessor = httpContextAccessor; - + _configuration = configuration; } #endregion @@ -58,6 +61,7 @@ namespace BMA.EHR.Application.Repositories using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _res = await client.GetAsync(apiPath); if (_res.IsSuccessStatusCode) { @@ -85,6 +89,7 @@ namespace BMA.EHR.Application.Repositories using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _res = await client.PostAsync(apiPath, stringContent); if (_res.IsSuccessStatusCode) { @@ -112,6 +117,7 @@ namespace BMA.EHR.Application.Repositories using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _res = await client.PostAsync(apiPath, stringContent); return _res.IsSuccessStatusCode; } diff --git a/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveRequestRepository.cs b/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveRequestRepository.cs index e15749c9..2272ea53 100644 --- a/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveRequestRepository.cs +++ b/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveRequestRepository.cs @@ -460,6 +460,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _res = await client.PostAsJsonAsync(apiUrlSalary, new { profileId = profile.Id, diff --git a/BMA.EHR.Application/Repositories/MessageQueue/InboxRepository.cs b/BMA.EHR.Application/Repositories/MessageQueue/InboxRepository.cs index d8ff485c..af44f06b 100644 --- a/BMA.EHR.Application/Repositories/MessageQueue/InboxRepository.cs +++ b/BMA.EHR.Application/Repositories/MessageQueue/InboxRepository.cs @@ -56,6 +56,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); diff --git a/BMA.EHR.Application/Repositories/MessageQueue/NotificationRepository.cs b/BMA.EHR.Application/Repositories/MessageQueue/NotificationRepository.cs index 7aa12290..0f4b89d8 100644 --- a/BMA.EHR.Application/Repositories/MessageQueue/NotificationRepository.cs +++ b/BMA.EHR.Application/Repositories/MessageQueue/NotificationRepository.cs @@ -60,6 +60,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -135,6 +136,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); diff --git a/BMA.EHR.Application/Repositories/Reports/ProbationReportRepository.cs b/BMA.EHR.Application/Repositories/Reports/ProbationReportRepository.cs index 78c77ff3..4289421f 100644 --- a/BMA.EHR.Application/Repositories/Reports/ProbationReportRepository.cs +++ b/BMA.EHR.Application/Repositories/Reports/ProbationReportRepository.cs @@ -51,6 +51,7 @@ namespace BMA.EHR.Application.Repositories.Reports using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Get, api_url); var res = await client.SendAsync(req); var result = await res.Content.ReadAsStringAsync(); @@ -133,6 +134,7 @@ namespace BMA.EHR.Application.Repositories.Reports using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Get, api_url); var res = await client.SendAsync(req); var result = await res.Content.ReadAsStringAsync(); @@ -426,6 +428,7 @@ namespace BMA.EHR.Application.Repositories.Reports using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Get, api_url); var res = await client.SendAsync(req); var result = await res.Content.ReadAsStringAsync(); @@ -632,6 +635,7 @@ namespace BMA.EHR.Application.Repositories.Reports using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Get, api_url); var res = await client.SendAsync(req); var result = await res.Content.ReadAsStringAsync(); @@ -882,6 +886,7 @@ namespace BMA.EHR.Application.Repositories.Reports using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var req = new HttpRequestMessage(HttpMethod.Get, api_url); var res = await client.SendAsync(req); var result = await res.Content.ReadAsStringAsync(); diff --git a/BMA.EHR.Discipline.Service/Controllers/DisciplineComplaint_AppealController.cs b/BMA.EHR.Discipline.Service/Controllers/DisciplineComplaint_AppealController.cs index 5fa8e9e1..822ac704 100644 --- a/BMA.EHR.Discipline.Service/Controllers/DisciplineComplaint_AppealController.cs +++ b/BMA.EHR.Discipline.Service/Controllers/DisciplineComplaint_AppealController.cs @@ -87,6 +87,7 @@ namespace BMA.EHR.DisciplineComplaint_Appeal.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -229,6 +230,7 @@ namespace BMA.EHR.DisciplineComplaint_Appeal.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); diff --git a/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs b/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs index 779b1611..9f9e0a2d 100644 --- a/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs +++ b/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs @@ -484,6 +484,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlDiscipline); var _res = await client.PostAsJsonAsync(apiUrlDiscipline, new { @@ -530,6 +531,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlDiscipline); var _res = await client.PostAsJsonAsync(apiUrlDiscipline, new { @@ -575,6 +577,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlDiscipline); var _res = await client.PostAsJsonAsync(apiUrlDiscipline, new { @@ -602,6 +605,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlDiscipline); var _res = await client.PostAsJsonAsync(apiUrlDiscipline, new { @@ -647,6 +651,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlDiscipline); var _res = await client.PostAsJsonAsync(apiUrlDiscipline, new { diff --git a/BMA.EHR.Placement.Service/Controllers/NotifyController.cs b/BMA.EHR.Placement.Service/Controllers/NotifyController.cs index 9d7b6ca7..01a40ae3 100644 --- a/BMA.EHR.Placement.Service/Controllers/NotifyController.cs +++ b/BMA.EHR.Placement.Service/Controllers/NotifyController.cs @@ -89,6 +89,7 @@ namespace BMA.EHR.Placement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -151,6 +152,7 @@ namespace BMA.EHR.Placement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs index dbdf1c5e..ff7a61ba 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs @@ -391,6 +391,7 @@ namespace BMA.EHR.Placement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -497,6 +498,7 @@ namespace BMA.EHR.Placement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var _res = await client.PostAsJsonAsync(apiUrl, new { diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentEmployeeController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentEmployeeController.cs index c3cfd000..c034240b 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentEmployeeController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentEmployeeController.cs @@ -387,6 +387,7 @@ namespace BMA.EHR.Placement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -493,6 +494,7 @@ namespace BMA.EHR.Placement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var _res = await client.PostAsJsonAsync(apiUrl, new { diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs index 52378395..9491fbda 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs @@ -222,6 +222,7 @@ namespace BMA.EHR.Placement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -585,6 +586,7 @@ namespace BMA.EHR.Placement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -768,6 +770,7 @@ namespace BMA.EHR.Placement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var _res = await client.PostAsJsonAsync(apiUrl, new { @@ -819,6 +822,7 @@ namespace BMA.EHR.Placement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs index 837c5165..864a821a 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs @@ -76,6 +76,7 @@ namespace BMA.EHR.Placement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -150,6 +151,7 @@ namespace BMA.EHR.Placement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -347,6 +349,7 @@ namespace BMA.EHR.Placement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs index cdfe9b16..09c2c84d 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs @@ -460,6 +460,7 @@ namespace BMA.EHR.Placement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -613,6 +614,7 @@ namespace BMA.EHR.Placement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var _res = await client.PostAsJsonAsync(apiUrl, new { diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs index ece8fd56..9012d1f2 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs @@ -76,6 +76,7 @@ namespace BMA.EHR.Placement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -228,6 +229,7 @@ namespace BMA.EHR.Placement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs index 9d65b179..173a760f 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs @@ -71,6 +71,7 @@ namespace BMA.EHR.Placement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -147,6 +148,7 @@ namespace BMA.EHR.Placement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -461,6 +463,7 @@ namespace BMA.EHR.Placement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementController.cs index 1f46a81e..c813db46 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementController.cs @@ -356,6 +356,7 @@ namespace BMA.EHR.Retirement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -372,6 +373,7 @@ namespace BMA.EHR.Retirement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementDeceasedController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementDeceasedController.cs index bc54fd38..64d45fb6 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementDeceasedController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementDeceasedController.cs @@ -87,6 +87,7 @@ namespace BMA.EHR.Retirement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -283,6 +284,7 @@ namespace BMA.EHR.Retirement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -328,6 +330,7 @@ namespace BMA.EHR.Retirement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Post, _apiUrl); var _res = await client.PostAsJsonAsync(_apiUrl, new { @@ -571,6 +574,7 @@ namespace BMA.EHR.Retirement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs index 62044356..75ea7007 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs @@ -76,6 +76,7 @@ namespace BMA.EHR.Retirement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -308,6 +309,7 @@ namespace BMA.EHR.Retirement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs index b31eb49c..11d0bef8 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs @@ -76,6 +76,7 @@ namespace BMA.EHR.Retirement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -269,6 +270,7 @@ namespace BMA.EHR.Retirement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs index c2161642..75a00725 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs @@ -128,6 +128,7 @@ namespace BMA.EHR.Retirement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync(); @@ -417,6 +418,7 @@ namespace BMA.EHR.Retirement.Service.Controllers using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _res = await client.SendAsync(_req); var _result = await _res.Content.ReadAsStringAsync();