/// <summary> /// Create from a singleton /// </summary> public ServiceInstanceInformation(Object singleton, DependencyServiceManager serviceManager) : this(serviceManager) { this.ServiceImplementer = singleton.GetType(); this.InstantiationType = this.ServiceImplementer.GetCustomAttribute <ServiceProviderAttribute>()?.Type ?? ServiceInstantiationType.Singleton; this.m_singletonInstance = singleton; this.ImplementedServices = this.ServiceImplementer.GetInterfaces().Where(o => typeof(IServiceImplementation).IsAssignableFrom(o)).ToArray(); }
/// <summary> /// Create a new service instance /// </summary> private ServiceInstanceInformation(DependencyServiceManager serviceManager) { this.m_serviceManager = serviceManager; }