Exemplo n.º 1
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 NavigationFixer(
     [NotNull] IChangeDetector changeDetector,
     [NotNull] IEntityGraphAttacher attacher)
 {
     _changeDetector = changeDetector;
     _attacher = attacher;
 }
Exemplo 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 QueryBuffer(
     [NotNull] IStateManager stateManager,
     [NotNull] IChangeDetector changeDetector)
 {
     _stateManager = stateManager;
     _changeDetector = changeDetector;
 }
 public ChangeTrackerFactory(
     [NotNull] IStateManager stateManager,
     [NotNull] IChangeDetector changeDetector,
     [NotNull] IEntityEntryGraphIterator graphIterator,
     [NotNull] ICurrentDbContext currentContext)
 {
     _stateManager = stateManager;
     _changeDetector = changeDetector;
     _graphIterator = graphIterator;
     _context = currentContext.Context;
 }
Exemplo n.º 4
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 ChangeTrackerFactory(
     [NotNull] ICurrentDbContext currentContext,
     [NotNull] IStateManager stateManager,
     [NotNull] IChangeDetector changeDetector,
     [NotNull] IModel model,
     [NotNull] IEntityEntryGraphIterator graphIterator)
 {
     _context        = currentContext.Context;
     _stateManager   = stateManager;
     _changeDetector = changeDetector;
     _model          = model;
     _graphIterator  = graphIterator;
 }
 public MySQLMigrationsModelDiffer(
     [NotNull] IRelationalTypeMappingSource typeMappingSource,
     [NotNull] IMigrationsAnnotationProvider migrationsAnnotations,
     [NotNull] IChangeDetector changeDetector,
     [NotNull] IUpdateAdapterFactory updateAdapterFactory,
     [NotNull] CommandBatchPreparerDependencies commandBatchPreparerDependencies)
     : base(
         typeMappingSource,
         migrationsAnnotations,
         changeDetector,
         updateAdapterFactory,
         commandBatchPreparerDependencies)
 {
 }
Exemplo n.º 6
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="ChangeTracker" /> class. Instances of this class are typically
        ///     obtained from <see cref="DbContext.ChangeTracker" /> and it is not designed to be directly constructed
        ///     in your application code.
        /// </summary>
        /// <param name="stateManager"> The internal state manager being used to store information about tracked entities. </param>
        /// <param name="changeDetector"> The internal change detector used to identify changes in tracked entities. </param>
        /// <param name="graphIterator"> The internal graph iterator used to traverse graphs of entities. </param>
        /// <param name="context"> The context this change tracker belongs to. </param>
        public ChangeTracker(
            [NotNull] IStateManager stateManager,
            [NotNull] IChangeDetector changeDetector,
            [NotNull] IEntityEntryGraphIterator graphIterator,
            [NotNull] DbContext context)
        {
            Check.NotNull(stateManager, nameof(stateManager));
            Check.NotNull(changeDetector, nameof(changeDetector));
            Check.NotNull(graphIterator, nameof(graphIterator));
            Check.NotNull(context, nameof(context));

            _stateManager   = stateManager;
            _changeDetector = changeDetector;
            _graphIterator  = graphIterator;
            _context        = context;
        }
        public ChangeTrackerFactory(
            [NotNull] IStateManager stateManager,
            [NotNull] IChangeDetector changeDetector,
            [NotNull] IEntityEntryGraphIterator graphIterator,
            [NotNull] DbContext context)
        {
            Check.NotNull(stateManager, nameof(stateManager));
            Check.NotNull(changeDetector, nameof(changeDetector));
            Check.NotNull(graphIterator, nameof(graphIterator));
            Check.NotNull(context, nameof(context));

            _stateManager = stateManager;
            _changeDetector = changeDetector;
            _graphIterator = graphIterator;
            _context = context;
        }
Exemplo n.º 8
0
        /// <summary>
        ///     Releases the allocated resources for this context.
        /// </summary>
        public virtual void Dispose()
        {
            if (!_disposed)
            {
                _disposed = true;

                _stateManager?.Unsubscribe();

                _serviceScope?.Dispose();
                _setInitializer = null;
                _changeTracker  = null;
                _stateManager   = null;
                _changeDetector = null;
                _graphAttacher  = null;
                _model          = null;
            }
        }
Exemplo n.º 9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SchemaAwareMigrationsModelDiffer"/> class.
 /// </summary>
 /// <param name="typeMappingSource">The type mapping source to use.</param>
 /// <param name="migrationsAnnotations">The migration annotation provider.</param>
 /// <param name="changeDetector">The change detector.</param>
 /// <param name="stateManagerDependencies">The state manager dependencies.</param>
 /// <param name="commandBatchPreparerDependencies">The command batch preparer dependencies.</param>
 public SchemaAwareMigrationsModelDiffer
 (
     IRelationalTypeMappingSource typeMappingSource,
     IMigrationsAnnotationProvider migrationsAnnotations,
     IChangeDetector changeDetector,
     StateManagerDependencies stateManagerDependencies,
     CommandBatchPreparerDependencies commandBatchPreparerDependencies
 )
     : base
     (
         typeMappingSource,
         migrationsAnnotations,
         changeDetector,
         stateManagerDependencies,
         commandBatchPreparerDependencies
     )
 {
 }
 /// <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 DbContextDependencies(
     [NotNull] IChangeDetector changeDetector,
     [NotNull] IDbSetSource setSource,
     [NotNull] IEntityFinderSource entityFinderSource,
     [NotNull] IEntityGraphAttacher entityGraphAttacher,
     [NotNull] IModel model,
     [NotNull] IAsyncQueryProvider queryProvider,
     [NotNull] IStateManager stateManager,
     [NotNull] IDiagnosticsLogger <DbLoggerCategory.Update> updateLogger,
     [NotNull] IDiagnosticsLogger <DbLoggerCategory.Infrastructure> infrastuctureLogger)
 {
     ChangeDetector      = changeDetector;
     SetSource           = setSource;
     EntityFinderSource  = entityFinderSource;
     EntityGraphAttacher = entityGraphAttacher;
     Model                = model;
     QueryProvider        = queryProvider;
     StateManager         = stateManager;
     UpdateLogger         = updateLogger;
     InfrastructureLogger = infrastuctureLogger;
 }
Exemplo n.º 11
0
 public ListeningInitializer(IChangeDetector detector)
 {
     _detector = detector ?? throw new ArgumentNullException(nameof(detector));
 }
 public DbContextDependenciesEx(ICurrentDbContext currentContext, IChangeDetector changeDetector, IDbSetSource setSource, IEntityFinderSource entityFinderSource, IEntityGraphAttacher entityGraphAttacher, IModel model, IAsyncQueryProvider queryProvider, IStateManager stateManager, IDiagnosticsLogger <DbLoggerCategory.Update> updateLogger, IDiagnosticsLogger <DbLoggerCategory.Infrastructure> infrastructureLogger)
 {
     inner = new DbContextDependencies(currentContext, changeDetector, setSource, entityFinderSource, entityGraphAttacher, model, queryProvider, new StateManagerWrapper(stateManager), updateLogger, infrastructureLogger);
 }
Exemplo n.º 13
0
 public virtual void Add(IChangeDetector detector)
 {
     _detectors.Add(new WeakReference <IChangeDetector>(detector));
 }
Exemplo n.º 14
0
 public CassandraMigrationsModelDiffer(RelationalConnectionDependencies relationalConnectionDependencies, IRelationalTypeMappingSource typeMappingSource, IMigrationsAnnotationProvider migrationsAnnotations, IChangeDetector changeDetector, IUpdateAdapterFactory updateAdapterFactory, CommandBatchPreparerDependencies commandBatchPreparerDependencies) : base(typeMappingSource, migrationsAnnotations, changeDetector, updateAdapterFactory, commandBatchPreparerDependencies)
 {
     _cassandraOptionsExtension = CassandraOptionsExtension.Extract(relationalConnectionDependencies.ContextOptions);
 }
 public SecurityQueryContextFactory([NotNull] DbContext dbContext, [NotNull] ICurrentDbContext currentContext, [NotNull] IStateManager stateManager, [NotNull] IConcurrencyDetector concurrencyDetector, [NotNull] IChangeDetector changeDetector) : base(currentContext, concurrencyDetector)
 {
     this.dbContext           = (BaseSecurityDbContext)dbContext;
     this.stateManager        = new LazyRef <IStateManager>(stateManager);
     this.concurrencyDetector = concurrencyDetector;
 }
Exemplo n.º 16
0
 /// <inheritdoc />
 public virtual void DetectingChanges(IChangeDetector changeDetector, IStateManager stateManager)
 {
 }
Exemplo n.º 17
0
 public SqlChangeTrackingMigrationsModelDiffer(IRelationalTypeMappingSource typeMappingSource,
                                               IMigrationsAnnotationProvider migrationsAnnotations, IChangeDetector changeDetector,
                                               IUpdateAdapterFactory updateAdapterFactory,
                                               CommandBatchPreparerDependencies commandBatchPreparerDependencies) : base(typeMappingSource,
                                                                                                                         migrationsAnnotations, changeDetector, updateAdapterFactory, commandBatchPreparerDependencies)
 {
 }
 public AbstraXProviderChangeTrackerFactory(ICurrentDbContext currentContext, IStateManager stateManager, IChangeDetector changeDetector, IModel model, IEntityEntryGraphIterator graphIterator) : base(currentContext, stateManager, changeDetector, model, graphIterator)
 {
     this.currentContext  = currentContext;
     this.stateManager    = stateManager;
     this.changeDetectory = changeDetector;
     this.model           = model;
     this.graphIterator   = graphIterator;
 }
Exemplo n.º 19
0
 public Repository(IServiceProvider _serviceProvider)
 {
     this.ChangeDetector = _serviceProvider?.GetService <IChangeDetector>();
     this.cache          = _serviceProvider?.GetService <IMemoryCache>();;
 }
Exemplo n.º 20
0
 /// <inheritdoc />
 public virtual void DetectingEntryChanges(IChangeDetector changeDetector, IStateManager stateManager, InternalEntityEntry entry)
 {
 }
Exemplo n.º 21
0
 public void Add(IChangeDetector detector) => Store.Add(detector);
 public override void DetectingChanges(IChangeDetector changeDetector, IStateManager stateManager)
 => DetectingChangesCalled = true;
Exemplo n.º 23
0
 public MyQueryContextFactory(IStateManager stateManager,
                              IConcurrencyDetector concurrencyDetector,
                              IChangeDetector changeDetector)
     : base(stateManager, concurrencyDetector, changeDetector)
 {
 }
Exemplo n.º 24
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 UpdateAdapter(IStateManager stateManager)
 {
     _stateManager   = stateManager;
     _changeDetector = _stateManager.Context.GetDependencies().ChangeDetector;
 }
 public override void DetectingEntryChanges(IChangeDetector changeDetector, IStateManager stateManager, InternalEntityEntry entry)
 => DetectingEntryChangesCalled = true;
 public MyQueryContextFactory(IStateManager stateManager, 
     IConcurrencyDetector concurrencyDetector, 
     IChangeDetector changeDetector) 
     : base(stateManager, concurrencyDetector, changeDetector)
 {
 }
Exemplo n.º 27
0
 public NavigationFixer([NotNull] IModel model, [NotNull] IChangeDetector changeDetector)
 {
     _model          = model;
     _changeDetector = changeDetector;
 }
 public FileContextQueryContextFactory(IStateManager stateManager, ICurrentDbContext context, IConcurrencyDetector concurrencyDetector, IChangeDetector changeDetector)
     : base(context, concurrencyDetector)
 {
 }
Exemplo n.º 29
0
 internal DefaultEntityContext(IEntitySource entitySource, IMappingsRepository mappingsRepository, IChangeDetector changeDetector)
 {
     _entitySource    = entitySource;
     Mappings         = mappingsRepository;
     _changeDetector  = changeDetector;
     _deletedEntities = new List <Iri>();
     _entityCache     = new ConcurrentDictionary <Iri, Entity>();
 }