Ejemplo n.º 1
0
 public EfCoreStorage(ILogger <EfCoreStorage> logger,
                      ConfigOptions capOptions,
                      EfCoreOptions options,
                      IServiceProvider serviceProvider)
 {
     _options         = options;
     _logger          = logger;
     _capOptions      = capOptions;
     _serviceProvider = serviceProvider;
 }
        private void AddSingletonEfCoreOptions(IServiceCollection services)
        {
            var efCoreOptions = new EfCoreOptions();

            _configure(efCoreOptions);

            if (efCoreOptions.DbContextType != null)
            {
                services.AddSingleton(x => {
                    //var dbContext = (Microsoft.EntityFrameworkCore.DbContext)x.GetRequiredService(efCoreOptions.DbContextType);

                    return(efCoreOptions);
                });
            }
            else
            {
                services.AddSingleton(efCoreOptions);
            }
        }
Ejemplo n.º 3
0
 public EfCoreStorageConnection(EfCoreOptions options, ConfigOptions configOptions, IServiceProvider serviceProvider)
 {
     _configOptions   = configOptions;
     _serviceProvider = serviceProvider;
     Options          = options;
 }
Ejemplo n.º 4
0
 public EfCoreMonitoringApi(EfCoreOptions options, IStorage storage)
 {
     _options = options ?? throw new ArgumentNullException(nameof(options));
     _storage = storage as EfCoreStorage ?? throw new ArgumentNullException(nameof(storage));;
 }
Ejemplo n.º 5
0
 public EfCorePublisher(IServiceProvider provider) : base(provider)
 {
     _options = provider.GetService <EfCoreOptions>();
 }
Ejemplo n.º 6
0
 public EfCoreCollectProcessor(ILogger <EfCoreCollectProcessor> logger,
                               EfCoreOptions efCoreOptions)
 {
     _logger  = logger;
     _options = efCoreOptions;
 }