feat(options): eager startup validation for edge/management options (InboundAPI, ESG, Notification, ManagementService) (arch-review 08 §1.5)

Claude-Session: https://claude.ai/code/session_01MtdgwpEeCUn6cUA5f1LMPj
This commit is contained in:
Joseph Doherty
2026-07-10 06:52:59 -04:00
parent 8b775f4ae1
commit fc918d4679
16 changed files with 404 additions and 4 deletions
@@ -1,4 +1,6 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Options;
namespace ZB.MOM.WW.ScadaBridge.ManagementService;
@@ -13,7 +15,11 @@ public static class ServiceCollectionExtensions
{
services.AddSingleton<ManagementActorHolder>();
services.AddOptions<ManagementServiceOptions>()
.BindConfiguration("ScadaBridge:ManagementService");
.BindConfiguration("ScadaBridge:ManagementService")
.ValidateOnStart();
services.TryAddEnumerable(
ServiceDescriptor.Singleton<IValidateOptions<ManagementServiceOptions>,
ManagementServiceOptionsValidator>());
return services;
}
}