Ejemplo n.º 1
0
        public void BuildUp(object target)
        {
            Type pluggedType             = target.GetType();
            IConfiguredInstance instance = _pipelineGraph.GetDefault(pluggedType) as IConfiguredInstance
                                           ?? new ConfiguredInstance(pluggedType);

            IInstanceBuilder builder = PluginCache.FindBuilder(pluggedType);
            var arguments            = new Arguments(instance, this);

            builder.BuildUp(arguments, target);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     The "BuildUp" method takes in an already constructed object
        ///     and uses Setter Injection to push in configured dependencies
        ///     of that object
        /// </summary>
        /// <param name="target"></param>
        public void BuildUp(object target)
        {
            Type pluggedType             = target.GetType();
            IConfiguredInstance instance = _pipelineGraph.GetDefault(pluggedType) as IConfiguredInstance
                                           ?? new ConfiguredInstance(pluggedType);

            IInstanceBuilder builder = _pipelineGraph.Outer.BuilderFor(pluggedType);
            var arguments            = new Arguments(instance, new BuildSession(_pipelineGraph));

            builder.BuildUp(arguments, target);
        }