Beispiel #1
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 NavigationFixer(
     [NotNull] IChangeDetector changeDetector,
     [NotNull] IEntityGraphAttacher attacher)
 {
     _changeDetector = changeDetector;
     _attacher       = attacher;
 }
Beispiel #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 DbContextDependencies(
            [NotNull] IChangeDetector changeDetector,
            [NotNull] IDbSetInitializer dbSetInitializer,
            [NotNull] IEntityFinderSource entityFinderSource,
            [NotNull] IEntityGraphAttacher entityGraphAttacher,
            [NotNull] IModel model,
            [NotNull] IAsyncQueryProvider queryProvider,
            [NotNull] IStateManager stateManager)
        {
            Check.NotNull(changeDetector, nameof(changeDetector));
            Check.NotNull(dbSetInitializer, nameof(dbSetInitializer));
            Check.NotNull(entityFinderSource, nameof(entityFinderSource));
            Check.NotNull(entityGraphAttacher, nameof(entityGraphAttacher));
            Check.NotNull(model, nameof(model));
            Check.NotNull(queryProvider, nameof(queryProvider));
            Check.NotNull(stateManager, nameof(stateManager));

            ChangeDetector      = changeDetector;
            DbSetInitializer    = dbSetInitializer;
            EntityFinderSource  = entityFinderSource;
            EntityGraphAttacher = entityGraphAttacher;
            Model         = model;
            QueryProvider = queryProvider;
            StateManager  = stateManager;
        }
 /// <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;
 }
Beispiel #4
0
 /// <summary>
 ///     Releases the allocated resources for this context.
 /// </summary>
 public virtual void Dispose()
 {
     _disposed = true;
     _serviceScope?.Dispose();
     _setInitializer = null;
     _changeTracker  = null;
     _stateManager   = null;
     _changeDetector = null;
     _graphAttacher  = null;
     _model          = null;
 }
 /// <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,
     [NotNull] ILoggingOptions loggingOptions)
 {
     _changeDetector = changeDetector;
     _attacher       = attacher;
     if (loggingOptions.IsSensitiveDataLoggingEnabled)
     {
         _sensitiveLoggingEnabled = true;
     }
 }
Beispiel #6
0
 private void SetEntityState(InternalEntityEntry entry, EntityState entityState)
 {
     if (entry.EntityState == EntityState.Detached)
     {
         (_graphAttacher
          ?? (_graphAttacher = ServiceProvider.GetRequiredService <IEntityGraphAttacher>()))
         .AttachGraph(entry, entityState);
     }
     else
     {
         entry.SetEntityState(entityState, acceptChanges: true);
     }
 }
Beispiel #7
0
 private void SetEntityState(InternalEntityEntry entry, EntityState entityState, GraphBehavior behavior)
 {
     if ((behavior == GraphBehavior.IncludeDependents) &&
         (entry.EntityState == EntityState.Detached))
     {
         (_graphAttacher
          ?? (_graphAttacher = ServiceProvider.GetRequiredService <IEntityGraphAttacher>()))
         .AttachGraph(entry, entityState);
     }
     else
     {
         entry.SetEntityState(entityState, acceptChanges: true);
     }
 }
 /// <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;
 }
Beispiel #9
0
 public ChangeDetector([NotNull] IEntityGraphAttacher attacher)
 {
     _attacher = attacher;
 }
 public ChangeDetectorProxy(IEntityGraphAttacher attacher)
     : base(attacher)
 {
 }
 public ChangeDetector([NotNull] IEntityGraphAttacher attacher)
 {
     _attacher = attacher;
 }
 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);
 }
 public ChangeDetectorProxy(IEntityGraphAttacher attacher)
     : base(attacher)
 {
 }