Feature Switches
Using the Feature Switch Attribute
class MyFeatureSwitchedHandler : RequestHandler<MyCommand>
{
[FeatureSwitch(typeof(MyFeatureSwitchedHandler), FeatureSwitchStatus.Config, step: 1)]
public override MyCommand Handle (MyCommand command)
{
/* Do work */
return base.Handle(command);
}
}class MyIncompleteHandlerAsync : RequestHandlerAsync<MyCommand>
{
[FeatureSwitchAsync(typeof(MyIncompleteHandlerAsync), FeatureSwitchStatus.Off, step: 1)]
public override Task<MyCommand> HandleAsync(MyCommand command, CancellationToken cancellationToken = default)
{
/* Nothing implmented so we're skipping this handler */
return await base.HandleAsync(command, cancellationToken);
}
}Building a config for Feature Switches with FluentConfigRegistryBuilder
Implementing a custom Feature Switch Registry
Setting Feature Switching Registry
Last updated
Was this helpful?
