示例#1
0
        public DIContainer RegisterProvider <TBase, TDerived>(IObjectProvider <TDerived> provider, string name = null) where TDerived : class, TBase
        {
            var key = new ContainerKey(typeof(TBase), name);

            _providers[key] = new ProviderWrapper <TDerived>(provider);
            return(this);
        }
示例#2
0
        public DIContainer RegisterProvider <T>(IObjectProvider <T> provider, string name = null) where T : class
        {
            var key = new ContainerKey(typeof(T), name);

            _providers[key] = new ProviderWrapper <T>(provider);
            return(this);
        }