Exemplo n.º 1
0
 public RouteAction Handle(ICall call)
 {
     if (_callResults.HasResultFor(call))
     {
         return(RouteAction.Return(_callResults.GetResult(call)));
     }
     return(RouteAction.Continue());
 }
Exemplo n.º 2
0
        public RouteAction Handle(ICall call)
        {
            if (_callResults.HasResultFor(call))
            {
                return(RouteAction.Return(_callResults.GetResult(call)));
            }

            var type = call.GetReturnType();
            var compatibleProviders = _autoValueProviders.Where(x => x.CanProvideValueFor(type)).FirstOrNothing();

            return(compatibleProviders.Fold(
                       RouteAction.Continue,
                       ReturnValueUsingProvider(call, type)));
        }