示例#1
0
 private object GetInstance(RegisteredObject registeredObject)
 {
     if (registeredObject.Instance == null ||
         registeredObject.LifeCycle == LifeCycle.Transient)
     {
         IEnumerable <object> parameters = ResolveConstructorParameters(registeredObject);
         object[]             paramArray = parameters.ToArray();
         registeredObject.CreateInstance(paramArray);
     }
     return(registeredObject.Instance);
 }