void IContainer.Configure(Type component, ComponentCallModelEnum callModel) { _callModels[component] = callModel; lock (_componentDefinitions) { if (!_componentDefinitions.ContainsKey(component)) { _componentDefinitions[component] = new ComponentConfig(); } } }
private void RegisterObjectDefinitionInContext(Type objectType, ComponentConfig componentConfig, ComponentCallModelEnum callModelEnum) { var builder = ObjectDefinitionBuilder.RootObjectDefinition(_factory, objectType) .SetAutowireMode(AutoWiringMode.AutoDetect) .SetSingleton(callModelEnum == ComponentCallModelEnum.Singleton); componentConfig.Configure(builder); IObjectDefinition objectDefinition = builder.ObjectDefinition; _context.RegisterObjectDefinition(objectType.FullName, objectDefinition); }