Exemplo n.º 1
0
        private InjectionExpression?DelegationFromResolver(TypeName typeName, IResolverContext resolver)
        {
            if (typeName != resolver.ReturnType)
            {
                return(null);
            }

            var args = resolver.Parameters
                       .Select(x => _caller.GetPriorInjectionExpression(x.TypeNameInfo, _factory) ?? ErrorPlaceHolder)
                       .Join(", ");

            return(new InjectionExpression(typeName,
                                           InjectionMethod.Resolver,
                                           $"{resolver.MethodName}({args})"));
        }