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>
 /// <typeparam name="TDefaultImpl">The default implementation 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>
 public static void Expose <TService, TDefaultImpl>(this IExpandR expandr, ServiceLifetime lifetime, bool multiple = false)
 => expandr.Expose(typeof(TService), lifetime, multiple, ExposedImplementation.FromType <TDefaultImpl>());