Table of Contents

Class RequireContextAttribute<TContext>

Namespace
NetCord.Services
Assembly
NetCord.Services.dll
public class RequireContextAttribute<TContext> : PreconditionAttribute<TContext> where TContext : IChannelContext

Type Parameters

TContext
Inheritance
RequireContextAttribute<TContext>
Inherited Members

Constructors

RequireContextAttribute(RequiredContext, string)

public RequireContextAttribute(RequiredContext requiredContext, string format = "Required context: {0}.")

Parameters

requiredContext RequiredContext
format string

{0} - required context

Properties

Format

public string Format { get; }

Property Value

string

RequiredContext

public RequiredContext RequiredContext { get; }

Property Value

RequiredContext

Methods

EnsureCanExecuteAsync(TContext, IServiceProvider?)

public override ValueTask<PreconditionResult> EnsureCanExecuteAsync(TContext context, IServiceProvider? serviceProvider)

Parameters

context TContext
serviceProvider IServiceProvider

Returns

ValueTask<PreconditionResult>