Пример #1
0
 public static IServiceContainer AddSingleton <TService>([NotNull] this IServiceContainer serviceContainer)
 {
     serviceContainer.Add(ServiceDefinition.Singleton <TService>());
     return(serviceContainer);
 }
Пример #2
0
 public static IServiceContainer AddSingleton <TService, TServiceImplement>([NotNull] this IServiceContainer serviceContainer) where TServiceImplement : TService
 {
     serviceContainer.Add(ServiceDefinition.Singleton <TService, TServiceImplement>());
     return(serviceContainer);
 }
Пример #3
0
 public static IServiceContainer AddSingleton <TService>([NotNull] this IServiceContainer serviceContainer, [NotNull] Func <IServiceProvider, object> func)
 {
     serviceContainer.Add(ServiceDefinition.Singleton <TService>(func));
     return(serviceContainer);
 }