/// <summary> /// Creates the action. /// </summary> /// <param name="host">The host.</param> /// <param name="methodInfo">The method info.</param> /// <returns></returns> protected virtual IAction CreateAction(IActionHost host, MethodInfo methodInfo) { var method = _methodFactory.CreateFrom(methodInfo); var asyncAtt = method.GetMetadata <AsyncActionAttribute>(); var filters = host.GetFilterManager(method); TryAddCanExecute(filters, method); if (asyncAtt == null) { return(new SynchronousAction(method, _messageBinder, filters)); } return(new AsynchronousAction(method, _messageBinder, filters, asyncAtt.BlockInteraction)); }
protected override IAction CreateAction(IActionHost host, MethodInfo methodInfo) { var method = _methodFactory.CreateFrom(methodInfo); var asyncAtt = method.GetMetadata<AsyncActionAttribute>(); var backAtt = method.GetMetadata<BackgroundActionAttribute>(); var filters = host.GetFilterManager(method); TryAddCanExecute(filters, method); if (asyncAtt != null) return new AsynchronousAction(method, _messageBinder, filters, asyncAtt.BlockInteraction); if (backAtt != null && backAtt.BackgroundEndMode != EndMode.Unspecified) return new BackgroundAction(method, _messageBinder, filters, backAtt.BlockInteraction); return new CustomSynchronousAction(method, _messageBinder, filters); }
protected override IAction CreateAction(IActionHost host, MethodInfo methodInfo) { var method = _methodFactory.CreateFrom(methodInfo); var asyncAtt = method.GetMetadata <AsyncActionAttribute>(); var backAtt = method.GetMetadata <BackgroundActionAttribute>(); var filters = host.GetFilterManager(method); TryAddCanExecute(filters, method); if (asyncAtt != null) { return(new AsynchronousAction(method, _messageBinder, filters, asyncAtt.BlockInteraction)); } if (backAtt != null && backAtt.BackgroundEndMode != EndMode.Unspecified) { return(new BackgroundAction(method, _messageBinder, filters, backAtt.BlockInteraction)); } return(new CustomSynchronousAction(method, _messageBinder, filters)); }
/// <summary> /// Creates the action. /// </summary> /// <param name="host">The host.</param> /// <param name="methodInfo">The method info.</param> /// <returns></returns> protected virtual IAction CreateAction(IActionHost host, MethodInfo methodInfo) { var method = _methodFactory.CreateFrom(methodInfo); var asyncAtt = method.GetMetadata<AsyncActionAttribute>(); var filters = host.GetFilterManager(method); TryAddCanExecute(filters, method); if(asyncAtt == null) return new SynchronousAction(method, _messageBinder, filters); return new AsynchronousAction(method, _messageBinder, filters, asyncAtt.BlockInteraction); }