/// <summary> /// The invoke. /// </summary> /// <param name="input"> /// The input. /// </param> /// <param name="getNext"> /// The get next. /// </param> /// <returns> /// The <see cref="IMethodReturn"/>. /// </returns> public IMethodReturn Invoke(IMethodInvocation input, GetNextInterceptionBehaviorDelegate getNext) { // Before invoking the method on the original target. var list = new List <object>(); foreach (var argument in input.Arguments) { list.Add(argument); } var group = new MethodInvocationValidator(input.MethodBase, list.ToArray()); group.Validate(); // Invoke the next behavior in the chain. var result = getNext()(input, getNext); // After invoking the method on the original target. return(result); }
public ValidationFilterAttribute(MethodInvocationValidator validator, ILoggerFactory loggerFactory) { _validator = validator; _logger = loggerFactory.CreateLogger("Destiny.Core.Flow.AspNetCore.Mvc.Filters"); }