Beispiel #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);
        }
Beispiel #2
0
        public BuildSession(PipelineGraph pipelineGraph, InterceptorLibrary interceptorLibrary)
        {
            _builder       = new ObjectBuilder(pipelineGraph, interceptorLibrary);
            _pipelineGraph = pipelineGraph;

            _defaults = new Cache <Type, Func <object> >(t =>
            {
                Instance instance = _pipelineGraph.GetDefault(t);

                if (instance == null)
                {
                    throw new StructureMapException(202, t);
                }

                return(() => CreateInstance(t, instance));
            });
        }