Exemple #1
0
 /// <summary>
 /// Initialize
 /// </summary>
 /// <param name="root"></param>
 /// <returns></returns>
 /// <exception cref="InvalidOperationException"></exception>
 public static ILogServiceCollection Initialize(IConfigurationRoot root)
 {
     if (_initialized)
     {
         throw new InvalidOperationException("You have initialized Cosmos.Logging.");
     }
     return(SoloDependencyContainer.Initialize(new ServiceCollection(), root));
 }
Exemple #2
0
        public static ILogServiceCollection Initialize(IConfigurationRoot root)
        {
            if (_initialized)
            {
                throw new InvalidOperationException("You have initialized Cosmos.Logging.");
            }
            IServiceCollection services = new ServiceCollection();

            services.TryAdd(ServiceDescriptor.Singleton <ILoggingServiceProvider, ConsoleLoggingServiceProvider>());
            return(SoloDependencyContainer.Initialize(services, root));
        }
 public static void AllDone(this ILogServiceCollection services)
 {
     SoloDependencyContainer.AllDone(services);
     LOGGER._initialized = true;
 }
 /// <summary>
 /// ALl done
 /// </summary>
 /// <param name="services"></param>
 public static void AllDone(this II18NServiceCollection services)
 {
     SoloDependencyContainer.AllDone(services);
 }
Exemple #5
0
 private static ILoggingServiceProvider TouchProvider() => SoloDependencyContainer.GetServiceResolver().GetService <ILoggingServiceProvider>();
Exemple #6
0
 /// <summary>
 /// Gets scoped service resolver
 /// </summary>
 /// <returns></returns>
 public static IServiceProvider GetScopedServiceResolver() => SoloDependencyContainer.GetScopedServiceResolver();
 /// <summary>
 /// Initialize
 /// </summary>
 /// <returns></returns>
 public static I18NServiceCollection Initialize()
 {
     return(SoloDependencyContainer.Initialize(new I18NServiceCollection()));
 }