Table of Contents

Class RequireContextAttribute

Namespace
Fluxer.Net.Commands
Assembly
Fluxer.Net.dll
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class RequireContextAttribute : PreconditionAttribute
Inheritance
object
Attribute
RequireContextAttribute
Inherited Members

Constructors

RequireContextAttribute(ContextType)

public RequireContextAttribute(ContextType contextTypes)

Parameters

contextTypes ContextType

Properties

Contexts

Gets the context required to execute the command.

public ContextType Contexts { get; }

Property Value

ContextType

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

context ICommandContext

The context of the command.

command CommandInfo

The command being executed.

services IServiceProvider

The service collection used for dependency injection.

Returns

Task<PreconditionResult>