Class ParameterPreconditionAttribute
Requires the parameter to pass the specified precondition before execution can begin.
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = true, Inherited = true)]
public abstract class ParameterPreconditionAttribute : Attribute
- Inheritance
-
objectAttributeParameterPreconditionAttribute
Methods
CheckPermissionsAsync(ICommandContext, ParameterInfo, object, IServiceProvider)
Checks whether the condition is met before execution of the command.
public abstract Task<PreconditionResult> CheckPermissionsAsync(ICommandContext context, ParameterInfo parameter, object value, IServiceProvider services)
Parameters
contextICommandContextThe context of the command.
parameterParameterInfoThe parameter of the command being checked against.
valueobjectThe raw value of the parameter.
servicesIServiceProviderThe service collection used for dependency injection.