예제 #1
0
        public IBinderInfo Bind(Type contract, Type implementation)
        {
            var binder = new BinderInfo(this, contract);

            CheckBindingCache(contract);
            Types.Add(contract, implementation);
            return(binder);
        }
예제 #2
0
        public IBinderInfo Bind(Type contract, Type implementation, object instance)
        {
            var binder = new BinderInfo(this, contract);

            CheckBindingCache(contract);
            Types.Add(contract, implementation);
            AddSingleton(contract, instance);
            return(binder);
        }
예제 #3
0
        public IBinderInfo <TImplementation> Bind <TContract, TImplementation>() where TImplementation : TContract
        {
            var binder = new BinderInfo <TImplementation>(this, typeof(TContract));

            CheckBindingCache(typeof(TContract));
            Types.Add(typeof(TContract), typeof(TImplementation));

            return(binder);
        }