Class RequireContextAttribute
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class RequireContextAttribute : PreconditionAttribute
- Inheritance
-
objectAttributeRequireContextAttribute
- Inherited Members
Constructors
RequireContextAttribute(ContextType)
public RequireContextAttribute(ContextType contextTypes)
Parameters
contextTypesContextType
Properties
Contexts
Gets the context required to execute the command.
public ContextType Contexts { get; }
Property Value
Methods
CheckPermissionsAsync(ICommandContext, CommandInfo, IServiceProvider)
Checks if the command has the sufficient permission to be executed.
public override Task<PreconditionResult> CheckPermissionsAsync(ICommandContext context, CommandInfo command, IServiceProvider services)
Parameters
contextICommandContextThe context of the command.
commandCommandInfoThe command being executed.
servicesIServiceProviderThe service collection used for dependency injection.