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:
@ -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 {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user