public ThrowingMonsterStateManager(
     IInternalEntityEntryFactory factory,
     IInternalEntityEntrySubscriber subscriber,
     IInternalEntityEntryNotifier notifier,
     IValueGenerationManager valueGeneration,
     IModel model,
     IDatabase database,
     IConcurrencyDetector concurrencyDetector,
     ICurrentDbContext currentContext)
     : base(factory, subscriber, notifier, valueGeneration, model, database, concurrencyDetector, currentContext)
 {
 }
Ejemplo n.º 2
0
        /// <summary>
        ///     This API supports the Entity Framework Core infrastructure and is not intended to be used 
        ///     directly from your code. This API may change or be removed in future releases.
        /// </summary>
        public virtual IDbContextServices Initialize(
            IServiceProvider scopedProvider,
            IDbContextOptions contextOptions,
            DbContext context)
        {
            _scopedProvider = scopedProvider;
            _contextOptions = contextOptions;
            _currentContext = new CurrentDbContext(context);

            _providerServices = new LazyRef<IDatabaseProviderServices>(() =>
                _scopedProvider.GetRequiredService<IDatabaseProviderSelector>().SelectServices());

            _modelFromSource = new LazyRef<IModel>(CreateModel);

            return this;
        }
Ejemplo n.º 3
0
 public SomeService(ICurrentDbContext context, IStrategy <TEntity> delete = null) => Delete = delete;
 public ImpatientQueryCompiler(ICurrentDbContext currentDbContext)
 {
     this.currentDbContext = currentDbContext;
 }
Ejemplo n.º 5
0
 /// <summary>
 ///     Clones this dependency parameter object with one service replaced.
 /// </summary>
 /// <param name="currentContext"> A replacement for the current dependency of this type. </param>
 /// <returns> A new parameter object with the given service replaced. </returns>
 public RelationalConventionSetBuilderDependencies With([NotNull] ICurrentDbContext currentContext)
 => new RelationalConventionSetBuilderDependencies(TypeMapper, AnnotationProvider, currentContext, SetFinder);
Ejemplo n.º 6
0
 /// <summary>
 ///     This API supports the Entity Framework Core infrastructure and is not intended to be used
 ///     directly from your code. This API may change or be removed in future releases.
 /// </summary>
 public QueryCompilationContextDependencies With([NotNull] ICurrentDbContext currentContext) => new QueryCompilationContextDependencies(
     Model,
     Logger,
     EntityQueryModelVisitorFactory,
     RequiresMaterializationExpressionVisitorFactory,
     Check.NotNull(currentContext, nameof(currentContext)));
Ejemplo n.º 7
0
 public DefaultFieldParser(ICurrentDbContext CurrentDbContext, ISqlGenerationHelper SqlGenerationHelper, IDbSetFinder DbSetFinder)
 {
     sqlGenerationHelper = SqlGenerationHelper;
     dbSetFinder         = DbSetFinder;
     context             = CurrentDbContext.Context;
 }
Ejemplo n.º 8
0
 public SqlServerSequenceProvider(ICurrentDbContext context)
 {
     this.context = context.Context;
 }
 public TestConventionalSetBuilder(IRelationalTypeMapper typeMapper,
     ICurrentDbContext currentContext,
     IDbSetFinder setFinder)
     : base(typeMapper, currentContext, setFinder)
 {
 }
 /// <summary>
 ///     Clones this dependency parameter object with one service replaced.
 /// </summary>
 /// <param name="currentContext"> A replacement for the current dependency of this type. </param>
 /// <returns> A new parameter object with the given service replaced. </returns>
 public ProviderConventionSetBuilderDependencies With([NotNull] ICurrentDbContext currentContext)
 => new ProviderConventionSetBuilderDependencies(
     TypeMappingSource, ConstructorBindingFactory, ParameterBindingFactories, MemberClassifier, Logger, ValidationLogger,
     SetFinder, currentContext, ModelValidator);
 public ReadOnlyRepository(ICurrentDbContext database)
 {
     _database = database.Context;
 }
Ejemplo n.º 12
0
 /// <summary>
 ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
 ///     the same compatibility standards as public APIs. It may be changed or removed without notice in
 ///     any release. You should only use it directly in your code with extreme caution and knowing that
 ///     doing so can result in application failures when updating to a new Entity Framework Core release.
 /// </summary>
 public BatchExecutor([NotNull] ICurrentDbContext currentContext)
 {
     CurrentContext = currentContext;
 }
 public Repository(ICurrentDbContext database) : base(database)
 {
     _database = database.Context;
 }
 public SchemaAwareMigrationAssembly(ICurrentDbContext currentContext, IDbContextOptions options,
                                     IMigrationsIdGenerator idGenerator, IDiagnosticsLogger <DbLoggerCategory.Migrations> logger, IServiceProvider provider) : base(currentContext, options, idGenerator, logger)
 {
     _context         = currentContext.Context;
     _serviceProvider = provider;
 }
Ejemplo n.º 15
0
        public MigrationFinder(IServiceProvider serviceProvider, ShellContext shellContext, ICurrentDbContext context, IDbContextOptions options,
                               IMigrationsIdGenerator migrationsIdGenerator, IDiagnosticsLogger <DbLoggerCategory.Migrations> logger)
            : base(context, options, migrationsIdGenerator, logger)
        {
            Guard.ArgumentNotNull(context, nameof(context));
            _shellContext    = shellContext;
            _serviceProvider = serviceProvider;
            var contextType = context.Context.GetType();

            _migrations = new LazyRef <IReadOnlyDictionary <string, TypeInfo> >(
                () =>
            {
                var dic = (
                    from t in _shellContext.Blueprint.Dependencies.Select(d => d.Type.GetTypeInfo())
                    where t.IsSubclassOf(typeof(Migration)) &&
                    t.GetCustomAttribute <MigrationAttribute>() != null &&
                    this.CanApply(t, contextType)
                    let id = t.GetCustomAttribute <MigrationAttribute>()?.Id
                             orderby id
                             select new { Key = id, Element = t })
                          .ToDictionary(i => i.Key, i => i.Element);

                return(new ReadOnlyDictionary <string, TypeInfo>(dic));
            });
        }
Ejemplo n.º 16
0
 /// <summary>
 ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
 ///     the same compatibility standards as public APIs. It may be changed or removed without notice in
 ///     any release. You should only use it directly in your code with extreme caution and knowing that
 ///     doing so can result in application failures when updating to a new Entity Framework Core release.
 /// </summary>
 public UpdateAdapterFactory(ICurrentDbContext currentContext)
 {
     _currentContext = currentContext;
 }
Ejemplo n.º 17
0
 public GirvsMigrationByTenantAssembly(ICurrentDbContext currentContext,
                                       IDbContextOptions options, IMigrationsIdGenerator idGenerator,
                                       IDiagnosticsLogger <DbLoggerCategory.Migrations> logger)
     : base(currentContext, options, idGenerator, logger)
 {
 }
Ejemplo n.º 18
0
 public SpannerBatchExecutor([NotNull] ICurrentDbContext currentContext, [NotNull] IExecutionStrategyFactory executionStrategyFactory) : base(currentContext, executionStrategyFactory)
 {
 }
 public NpgsqlSequenceProvider(ICurrentDbContext context)
 {
     this.context = context.Context;
 }
Ejemplo n.º 20
0
 public static IDbContextDependencies GetDependencies([NotNull] this ICurrentDbContext currentContext)
 => currentContext.Context;
Ejemplo n.º 21
0
#pragma warning restore 618

        /// <summary>
        ///     Clones this dependency parameter object with one service replaced.
        /// </summary>
        /// <param name="currentContext"> A replacement for the current dependency of this type. </param>
        /// <returns> A new parameter object with the given service replaced. </returns>
        public RelationalConventionSetBuilderDependencies With([NotNull] ICurrentDbContext currentContext)
#pragma warning disable 618
        => new RelationalConventionSetBuilderDependencies(TypeMappingSource, Logger, currentContext, SetFinder, TypeMapper);
 public ZStateManager(IInternalEntityEntryFactory factory, IInternalEntityEntrySubscriber subscriber, IInternalEntityEntryNotifier notifier, IValueGenerationManager valueGeneration, IModel model, IDatabase database, IConcurrencyDetector concurrencyDetector, ICurrentDbContext currentContext, ILoggingOptions loggingOptions, IDiagnosticsLogger <DbLoggerCategory.Update> updateLogger)
     : base(factory, subscriber, notifier, valueGeneration, model, database, concurrencyDetector, currentContext, loggingOptions, updateLogger)
 {
 }
 /// <summary>
 ///     Clones this dependency parameter object with one service replaced.
 /// </summary>
 /// <param name="currentContext"> A replacement for the current dependency of this type. </param>
 /// <returns> A new parameter object with the given service replaced. </returns>
 public RelationalConventionSetBuilderDependencies With([NotNull] ICurrentDbContext currentContext)
 => new RelationalConventionSetBuilderDependencies(TypeMappingSource, Logger, currentContext, SetFinder);
Ejemplo n.º 24
0
 /// <summary>
 ///     Clones this dependency parameter object with one service replaced.
 /// </summary>
 /// <param name="currentContext"> A replacement for the current dependency of this type. </param>
 /// <returns> A new parameter object with the given service replaced. </returns>
 public CompiledQueryCacheKeyGeneratorDependencies With([NotNull] ICurrentDbContext currentContext)
 => new CompiledQueryCacheKeyGeneratorDependencies(Model, currentContext);
Ejemplo n.º 25
0
 public NopLazyLoader(ICurrentDbContext currentContext, IDiagnosticsLogger <DbLoggerCategory.Infrastructure> logger)
 {
     _currentContext   = currentContext;
     _efCoreLazyLoader = new LazyLoader(currentContext, logger);
 }
Ejemplo n.º 26
0
 /// <summary>
 ///     Clones this dependency parameter object with one service replaced.
 /// </summary>
 /// <param name="currentContext"> A replacement for the current dependency of this type. </param>
 /// <returns> A new parameter object with the given service replaced. </returns>
 public QueryContextDependencies With([NotNull] ICurrentDbContext currentContext)
 => new QueryContextDependencies(currentContext, ExecutionStrategyFactory, ConcurrencyDetector, CommandLogger, QueryLogger);
Ejemplo n.º 27
0
        public NpgsqlModuleHistoryRepository(HistoryRepositoryDependencies dependencies, ICurrentDbContext currentDbContext)
            : base(dependencies)
        {
            var dbContext = currentDbContext.Context as ModuleDbContext;

            modulePrefix = $"_{dbContext.ModuleMetaInfo.ModuleName}";
        }
 /// <summary>
 ///     Clones this dependency parameter object with one service replaced.
 /// </summary>
 /// <param name="currentDbContext"> A replacement for the current dependency of this type. </param>
 /// <returns> A new parameter object with the given service replaced. </returns>
 public ExecutionStrategyDependencies With([NotNull] ICurrentDbContext currentDbContext)
 => new ExecutionStrategyDependencies(currentDbContext, Options, Logger);
 /// <summary>
 /// Initialize a relational seeder
 /// </summary>
 /// <param name="currentDbContext">The current db context</param>
 /// <param name="seedRepository">The seed repository</param>
 /// <param name="seedAssembly">The seed assembly</param>
 /// <param name="seedDependencies">The relational seed dependencies</param>
 public RelationalSeeder(ICurrentDbContext currentDbContext, ISeedRepository seedRepository, ISeedAssembly seedAssembly, ILoggerFactory loggerFactory, HistoryRepositoryDependencies seedDependencies) : base(currentDbContext, seedRepository, seedAssembly, loggerFactory, seedDependencies.Options)
 {
     _seedDependencies = seedDependencies;
 }
Ejemplo n.º 30
0
 /// <summary>
 ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
 ///     the same compatibility standards as public APIs. It may be changed or removed without notice in
 ///     any release. You should only use it directly in your code with extreme caution and knowing that
 ///     doing so can result in application failures when updating to a new Entity Framework Core release.
 /// </summary>
 public BatchExecutor([NotNull] ICurrentDbContext currentContext, [NotNull] IExecutionStrategyFactory executionStrategyFactory)
 {
     CurrentContext           = currentContext;
     ExecutionStrategyFactory = executionStrategyFactory;
 }
Ejemplo n.º 31
0
 /// <summary>
 ///     Clones this dependency parameter object with one service replaced.
 /// </summary>
 /// <param name="currentDbContext"> A replacement for the current dependency of this type. </param>
 /// <returns> A new parameter object with the given service replaced. </returns>
 public QueryContextDependencies With([NotNull] ICurrentDbContext currentDbContext)
 => new QueryContextDependencies(currentDbContext, ConcurrencyDetector, CommandLogger, QueryLogger);
Ejemplo n.º 32
0
 public DefaultLolitaUpdateExecutor(ICurrentDbContext CurrentDbContext, ISqlGenerationHelper SqlGenerationHelper, IDbSetFinder DbSetFinder)
 {
     sqlGenerationHelper = SqlGenerationHelper;
     dbSetFinder         = DbSetFinder;
     context             = CurrentDbContext.Context;
 }
 public PerDbContextCompiledQueryCache(IDbContextServices contextServices)
     : base(contextServices)
 {
     _currentDbContext = contextServices.CurrentContext;
 }