public ConditionCopyNonLazyBinder FromInstance(object instance) { BindingUtil.AssertInstanceDerivesFromOrEqual(instance, AllParentTypes); ProviderFunc = (container) => new InstanceProvider(ContractType, instance, container); return(this); }
protected ScopeConcreteIdArgConditionCopyNonLazyBinder FromInstanceBase(object instance) { BindingUtil.AssertInstanceDerivesFromOrEqual(instance, AllParentTypes); BindInfo.RequireExplicitScope = false; // Don't know how it's created so can't assume here that it violates AsSingle BindInfo.MarkAsCreationBinding = false; SubFinalizer = new ScopableBindingFinalizer( BindInfo, (container, type) => new InstanceProvider(type, instance, container)); return(new ScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo)); }