Class PolicySimulatorServiceExtensions
- Namespace
- ReferenceApplication.Web.Extensions
- Assembly
- ReferenceApplication.Web.dll
Registers and maps the explicitly enabled, Development-only governance policy simulator.
public static class PolicySimulatorServiceExtensions
- Inheritance
-
PolicySimulatorServiceExtensions
- Inherited Members
Fields
EvaluatePath
Gets the route that evaluates a simulation.
public const string EvaluatePath = "/api/v1/policy-simulator/evaluate"
Field Value
Methods
AddApplicationPolicySimulator(IServiceCollection, IConfiguration, IHostEnvironment)
Registers the simulator only when its switch is enabled in Development.
public static IServiceCollection AddApplicationPolicySimulator(this IServiceCollection services, IConfiguration configuration, IHostEnvironment environment)
Parameters
servicesIServiceCollectionThe service collection to configure.
configurationIConfigurationThe application configuration.
environmentIHostEnvironmentThe host environment.
Returns
- IServiceCollection
The same service collection so calls can be chained.
Remarks
Call after AddApplicationAsiBackbone and AddApplicationCapabilityTokens: the simulator composes
the constraints, decision policy, and capability validator they register.
IsActive(IConfiguration, IHostEnvironment)
Determines whether the feature switch is enabled in the Development environment.
public static bool IsActive(IConfiguration configuration, IHostEnvironment environment)
Parameters
configurationIConfigurationThe application configuration.
environmentIHostEnvironmentThe host environment.
Returns
MapApplicationPolicySimulator(WebApplication)
Maps the administrator-only evaluation route only for an active Development simulator.
public static WebApplication MapApplicationPolicySimulator(this WebApplication app)
Parameters
appWebApplicationThe application.
Returns
- WebApplication
The same application so calls can be chained.