Ejemplo n.º 1
0
        public void Register(Type type, Type impl)
        {
            CheckAlreadyAdded(type);

            var resolver = new TransientResolver(this, impl);

            _resolvers.Add(type, resolver);
        }
        public SingleInstanceResolver(IIoc ioc, Type type)
        {
            Resolve = () =>
            {
                // first resolve. Using transient resolver
                if (_singleInstance == null)
                {
                    var transientResolver = new TransientResolver(ioc, type);
                    _singleInstance = transientResolver.Resolve();
                }

                return(_singleInstance);
            };
        }