Ejemplo n.º 1
0
 public static IServiceCollection AddDisposableSingleton <TService>(
     [NotNull] this IServiceCollection collection, [NotNull] IDisposable instance)
 {
     collection.Add(ServiceDescriptor.DisposableSingleton <TService>(instance));
     return(collection);
 }
Ejemplo n.º 2
0
 public static IServiceCollection AddSingleton <TService>(
     [NotNull] this IServiceCollection collection, [NotNull] object instance)
 {
     collection.Add(ServiceDescriptor.Singleton <TService>(instance));
     return(collection);
 }