/// <inheritdoc />
        public void OnProvidersExecuting(ActionConstraintProviderContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            for (var i = 0; i < context.Results.Count; i++)
            {
                ProvideConstraint(context.Results[i], context.HttpContext.RequestServices);
            }
        }
        /// <inheritdoc />
        public void OnProvidersExecuting(ActionConstraintProviderContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            for (var i = 0; i < context.Results.Count; i++)
            {
                ProvideConstraint(context.Results[i], context.HttpContext.RequestServices);
            }
        }
Exemple #3
0
        private void ExecuteProviders(HttpContext httpContext, ActionDescriptor action, List <ActionConstraintItem> items)
        {
            var context = new ActionConstraintProviderContext(httpContext, action, items);

            for (var i = 0; i < _actionConstraintProviders.Length; i++)
            {
                _actionConstraintProviders[i].OnProvidersExecuting(context);
            }

            for (var i = _actionConstraintProviders.Length - 1; i >= 0; i--)
            {
                _actionConstraintProviders[i].OnProvidersExecuted(context);
            }
        }
 public void OnProvidersExecuting(ActionConstraintProviderContext context)
 {
     foreach (var item in context.Results)
     {
         var marker = item.Metadata as BooleanConstraintMarker;
         if (marker != null)
         {
             Assert.Null(item.Constraint);
             item.Constraint = new BooleanConstraint() { Pass = marker.Pass };
         }
     }
 }
 public void OnProvidersExecuted(ActionConstraintProviderContext context)
 {
 }
 /// <inheritdoc />
 public void OnProvidersExecuted(ActionConstraintProviderContext context)
 {
 }