/// <summary> /// 注册 /// </summary> /// <param name="serviceType"></param> /// <param name="implementationTypeInstance"></param> /// <param name="serviceLifetime"></param> /// <returns></returns> public IIoc AddType(Type serviceType, object implementationTypeInstance, ServiceLifetime serviceLifetime, InjectType injectMode, object[] parameters = null) { TypeItemObject typeItemObject = new TypeItemObject(serviceType, implementationTypeInstance, parameters, serviceLifetime, injectMode); TypeItemObject.TypeItemObjectCollectionObject.Add(typeItemObject); return(this); }
public static Dictionary <Type, TypeItemObject> Add(this Dictionary <Type, TypeItemObject> keyValuePairs, TypeItemObject typeItemObject) { keyValuePairs.AddAndSet(typeItemObject.ServiceType, typeItemObject); return(keyValuePairs); }