예제 #1
0
        public void PrepareBasic()
        {
            container = ObjectResolver.Create();

            RegisterBasic(container);

            container.Compile();
        }
예제 #2
0
        public void Setup()
        {
            _container = ObjectResolver.Create();

            MicroResolverRelated.Bind(_container);

            _container.Compile();

            MicroResolverRelated.ResolveGeneric(_container);
            MicroResolverRelated.ResolveNonGeneric(_container);
        }
예제 #3
0
        public void Prepare()
        {
            container = ObjectResolver.Create();


            RegisterBasic(container);
            RegisterPropertyInjection(container);
            RegisterMultiple(container);

            container.Compile();
        }
예제 #4
0
        public void Setup()
        {
            _kernel = ObjectResolver.Create();

            _kernel.Register <IA, A>(Lifestyle.Transient);
            _kernel.Register <IB, B>(Lifestyle.Transient);
            _kernel.Register <IC, C>(Lifestyle.Transient);

            _kernel.Compile();

            _kernel.Resolve <IA>();
            _kernel.Resolve <IB>();
            _kernel.Resolve <IC>();
        }
예제 #5
0
        public void Setup()
        {
            _kernel = ObjectResolver.Create();

            _kernel.Register <IA, A>(Lifestyle.Singleton);
            _kernel.Register <IB, B>(Lifestyle.Singleton);
            _kernel.Register <IC, C>(Lifestyle.Singleton);

            _kernel.Compile();

            _kernel.Resolve(typeof(IA));
            _kernel.Resolve(typeof(IB));
            _kernel.Resolve(typeof(IC));
        }
예제 #6
0
        public IContainer <TState> Build()
        {
            if (_alreadyBuilt)
            {
                throw new InvalidOperationException("Container is already built");
            }
            _resolver.Compile();
            foreach (var type in _registeredTypes)
            {
                _resolver.Resolve(type);
            }
            BuildExecutionOrder();
            _alreadyBuilt = true;
            ContainerProvider <TState> .EndCreation();

            return(this);
        }