Exemple #1
0
 /// <summary>
 /// Exposes a service type to ExpandR, so that plugins can implement it.
 /// </summary>
 /// <typeparam name="TService">The service (interface) type.</typeparam>
 /// <param name="lifetime">The lifetime of the service.</param>
 /// <param name="multiple">Whether the service can have multiple implementations, or at most one.</param>
 /// <param name="defaultFactory">Default factory implementation for the service.</param>
 public static void Expose <TService>(this IExpandR expandr, ServiceLifetime lifetime, bool multiple, Func <IServiceProvider, TService> defaultFactory)
 => expandr.Expose(typeof(TService), lifetime, multiple, ExposedImplementation.FromFactory(defaultFactory));