You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most features can be configured and/or disabled through the configuration.
Configuration is injected in the constructor.
Example
classBasicCommand:ResilientCommand<string>{publicBasicCommand():base(configuration:CommandConfiguration.CreateConfiguration(
config =>{// all config is here.})){}protectedoverrideTask<string>RunAsync(CancellationTokencancellationToken){returnTask.FromResult("MyCommand");}}
Sometimes it might be preferable to disable certain features.
There is a static class CommandConfigurationManager that can help you with this. Simply call GetCommandConfiguration() and give it the CommandKey of the command, you will get the instance of configuration it is running on.
publicvoidDoStuff(){varcommand=newBasicCommand();// Default settings.CommandConfigurationManager.GetCommandConfiguration(command.CommandKey).FallbackSettings.IsEnabled=false;awaitcommand.ExecuteAsync(default);// Fallback will be disabled.}