/// <summary> /// Bind type /// </summary> /// <param name="bindingTypes"></param> internal void Bind(TypesBinder bindingTypes) { if (bindingTypes.ImplementType != null) { _addBindingWrapper.Add( bindingTypes.Services, bindingTypes.SingleType, bindingTypes.ImplementType, bindingTypes.LifeTimeOptions, bindingTypes.IsPropertiesAutoWired); } else if (bindingTypes.IsImplementByInterface) { _implementByInterfaceHelper.Add( bindingTypes.Services, bindingTypes.SingleType, bindingTypes.LifeTimeOptions, bindingTypes.IsPropertiesAutoWired); } else { _addBindingWrapper.Add( bindingTypes.Services, bindingTypes.SingleType, null, bindingTypes.LifeTimeOptions, bindingTypes.IsPropertiesAutoWired); } }
/// <summary> /// Bind range types /// </summary> /// <param name="bindingTypes"></param> /// <param name="types"></param> internal void Bind(TypesBinder bindingTypes, IEnumerable <Type> types) { types = (Type[])types; if (types == null || !types.Any()) { return; } foreach (var type in types) { if (bindingTypes.IsImplementByInterface) { _implementByInterfaceHelper.Add( bindingTypes.Services, type, bindingTypes.LifeTimeOptions, bindingTypes.IsPropertiesAutoWired); } else { _addBindingWrapper.Add( bindingTypes.Services, type, null, bindingTypes.LifeTimeOptions, bindingTypes.IsPropertiesAutoWired); } } }