public virtual void Register(Type component) { if (component == null) { throw new ArgumentNullException(); } Register(ComponentContextUtils.GetComponentDefaultName(component), ComponentContextUtils.CreateLocalFactory(component)); }
public virtual void Register(string name, Type componentType) { if (componentType == null) { throw new ArgumentNullException(nameof(componentType)); } Register(name, ComponentContextUtils.CreateLocalFactory(componentType)); }
private void RegisterBuiltInComponents() { InternalRegister(typeof(DefaultComponentCache), null, ComponentContextUtils.CreateLocalFactory(typeof(DefaultComponentCache)), false); InternalRegister(typeof(ContractAgnosticComponentCache), null, ComponentContextUtils.CreateLocalFactory(typeof(ContractAgnosticComponentCache)), false); InternalRegister(typeof(StaticComponentCache), null, ComponentContextUtils.CreateLocalFactory(typeof(StaticComponentCache)), false); InternalRegister(typeof(ThreadLocalComponentCache), null, ComponentContextUtils.CreateLocalFactory(typeof(ThreadLocalComponentCache)), false); }
public virtual void Register(Type contract, string name, Type component) { if (contract == null) { throw new ArgumentNullException(nameof(contract)); } if (component == null) { throw new ArgumentNullException(nameof(component)); } ComponentContextUtils.ThrowIfNotSubTypeOf(contract, component); InternalRegister(contract, name, ComponentContextUtils.CreateLocalFactory(component), true); }