private IEnumerable <Expression> BuildConstructionParameterExpressions(DynamicBuildPlanGenerationContext buildContext, SelectedConstructor selectedConstructor, string constructorSignature) { int i = 0; var constructionParameters = selectedConstructor.Constructor.GetParameters(); foreach (IDependencyResolverPolicy parameterResolver in selectedConstructor.GetParameterResolvers()) { yield return(buildContext.CreateParameterExpression( parameterResolver, constructionParameters[i].ParameterType, Expression.Call(null, SetCurrentOperationToResolvingParameterMethod, Expression.Constant(constructionParameters[i].Name, typeof(string)), Expression.Constant(constructorSignature), buildContext.ContextParameter))); i++; } }
private IEnumerable <Expression> BuildMethodParameterExpressions(DynamicBuildPlanGenerationContext context, SelectedMethod method, string methodSignature) { int i = 0; var methodParameters = method.Method.GetParameters(); foreach (IDependencyResolverPolicy parameterResolver in method.GetParameterResolvers()) { yield return(context.CreateParameterExpression( parameterResolver, methodParameters[i].ParameterType, Expression.Call(null, SetCurrentOperationToResolvingParameterMethod, Expression.Constant(methodParameters[i].Name, typeof(string)), Expression.Constant(methodSignature), context.ContextParameter))); i++; } }
private IEnumerable<Expression> BuildConstructionParameterExpressions(DynamicBuildPlanGenerationContext buildContext, SelectedConstructor selectedConstructor, string constructorSignature) { int i = 0; var constructionParameters = selectedConstructor.Constructor.GetParameters(); foreach (string parameterKey in selectedConstructor.GetParameterKeys()) { yield return buildContext.CreateParameterExpression( parameterKey, constructionParameters[i].ParameterType, Expression.Call(null, setCurrentOperationToResolvingParameter, Expression.Constant(constructionParameters[i].Name, typeof(string)), Expression.Constant(constructorSignature), buildContext.ContextParameter ) ); i++; } }
private IEnumerable<Expression> BuildMethodParameterExpressions(DynamicBuildPlanGenerationContext context, SelectedMethod method, string methodSignature) { int i = 0; var methodParameters = method.Method.GetParameters(); foreach (string parameterKey in method.GetParameterKeys()) { yield return context.CreateParameterExpression( parameterKey, methodParameters[i].ParameterType, Expression.Call(null, setCurrentOperationToResolvingParameter, Expression.Constant(methodParameters[i].Name, typeof(string)), Expression.Constant(methodSignature), context.ContextParameter)); i++; } }