Align .editorconfig files

When debugging only
app.Services.GetRequiredService<IPCRBService>();

Injected AppSettings instead of using GetEnvironmentVariable at Services level

Get ready to use VSCode IDE
This commit is contained in:
2024-12-03 12:23:56 -07:00
parent 89790f4fc1
commit 538b1f817e
72 changed files with 3420 additions and 391 deletions

View File

@ -1,4 +1,5 @@
using MesaFabApproval.API.Services;
using MesaFabApproval.Models;
using MesaFabApproval.Shared.Models;
using MesaFabApproval.Shared.Services;
@ -17,12 +18,14 @@ public class MRBController : ControllerBase {
private readonly string _mrbAttachmentPath;
public MRBController(ILogger<MRBController> logger, IMRBService mrbService, IMonInWorkerClient monInClient) {
public MRBController(ILogger<MRBController> logger,
IMRBService mrbService,
IMonInWorkerClient monInClient,
AppSettings appSettings) {
_logger = logger ?? throw new ArgumentNullException("ILogger not injected");
_mrbService = mrbService ?? throw new ArgumentNullException("IMRBService not injected");
_monInClient = monInClient ?? throw new ArgumentNullException("IMonInWorkerClient not injected");
_mrbAttachmentPath = Environment.GetEnvironmentVariable("FabApprovalMrbAttachmentPath") ??
throw new ArgumentNullException("FabApprovalMrbAttachmentPath environment variable not found");
_mrbAttachmentPath = appSettings.MrbAttachmentPath;
}
[HttpPost]
@ -523,7 +526,7 @@ public class MRBController : ControllerBase {
if (mrbNumber <= 0) throw new ArgumentException($"{mrbNumber} is not a valid MRB#");
List<MRBActionAttachment> attachments =
List<MRBActionAttachment> attachments =
(await _mrbService.GetAllActionAttachmentsForMRB(mrbNumber, bypassCache)).ToList();
return Ok(attachments);
@ -969,4 +972,4 @@ public class MRBController : ControllerBase {
}
}
}
}
}