Exemple #1
0
        public static IEnumerable <object> ResolveConstructorScopedArguments(this IBuilderContext context)
        {
            var constructor = context.SelectConstructor();

            if (constructor == null)
            {
                throw new InvalidOperationException("Call after TypeMapping Stage.");
            }

            var operation = context.CurrentOperation;

            foreach (var p in constructor.Constructor.FindScopedParameters())
            {
                context.CurrentOperation = new MethodArgumentResolveOperation(p.ParameterType, null, p.Name);
                yield return(context.GetOverriddenResolver(context.BuildKey.Type).Resolve(context));
            }
            context.CurrentOperation = operation;
        }