public object BuildObject(LiteApiServiceResolver serviceResolver) { var parameters = new object[_constructorParamTypes.Length]; for (int i = 0; i < parameters.Length; i++) { parameters[i] = serviceResolver.Resolve(_constructorParamTypes[i]); } return(_constructorInfo.Invoke(parameters)); }
public object GetService(LiteApiServiceResolver serviceResolver) { if (Factory != null) { return(Factory()); } if (IsSingleton) { if (SingletonInstance == null) { SingletonInstance = BuildObject(serviceResolver); } return(SingletonInstance); } return(BuildObject(serviceResolver)); }