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