Class RequireContextAttribute<TContext>
public class RequireContextAttribute<TContext> : PreconditionAttribute<TContext> where TContext : IChannelContext
Type Parameters
TContext
- Inheritance
-
PreconditionAttribute<TContext>RequireContextAttribute<TContext>
- Inherited Members
Constructors
RequireContextAttribute(RequiredContext, string)
public RequireContextAttribute(RequiredContext requiredContext, string format = "Required context: {0}.")
Parameters
requiredContext
RequiredContextformat
string{0} - required context
Properties
Format
public string Format { get; }
Property Value
RequiredContext
public RequiredContext RequiredContext { get; }
Property Value
Methods
EnsureCanExecuteAsync(TContext, IServiceProvider?)
public override ValueTask<PreconditionResult> EnsureCanExecuteAsync(TContext context, IServiceProvider? serviceProvider)
Parameters
context
TContextserviceProvider
IServiceProvider