public ConditionCopyNonLazyBinder FromInstance(object instance)
        {
            BindingUtil.AssertInstanceDerivesFromOrEqual(instance, AllParentTypes);

            ProviderFunc =
                (container) => new InstanceProvider(ContractType, instance, container);

            return(this);
        }
Ejemplo n.º 2
0
        protected ScopeConditionCopyNonLazyBinder FromInstanceBase(object instance)
        {
            BindingUtil.AssertInstanceDerivesFromOrEqual(instance, AllParentTypes);

            BindInfo.RequireExplicitScope = false;
            SubFinalizer = new ScopableBindingFinalizer(
                BindInfo, SingletonTypes.FromInstance, instance,
                (container, type) => new InstanceProvider(type, instance, container));

            return(new ScopeConditionCopyNonLazyBinder(BindInfo));
        }