示例#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 ChangeTracker(
            [NotNull] DbContext context,
            [NotNull] IStateManager stateManager,
            [NotNull] IChangeDetector changeDetector,
            [NotNull] IModel model,
            [NotNull] IEntityEntryGraphIterator graphIterator)
        {
            Check.NotNull(context, nameof(context));
            Check.NotNull(stateManager, nameof(stateManager));
            Check.NotNull(changeDetector, nameof(changeDetector));

            Context = context;

            _queryTrackingBehavior = context
                                     .GetService <IDbContextOptions>()
                                     .Extensions
                                     .OfType <CoreOptionsExtension>()
                                     .FirstOrDefault()
                                     ?.QueryTrackingBehavior
                                     ?? QueryTrackingBehavior.TrackAll;

            StateManager   = stateManager;
            ChangeDetector = changeDetector;
            _model         = model;
            GraphIterator  = graphIterator;
        }
示例#2
0
    public ChangeTracker(
        DbContext context,
        IStateManager stateManager,
        IChangeDetector changeDetector,
        IModel model,
        IEntityEntryGraphIterator graphIterator)
    {
        Context = context;

        _defaultQueryTrackingBehavior
            = context
              .GetService <IDbContextOptions>()
              .Extensions
              .OfType <CoreOptionsExtension>()
              .FirstOrDefault()
              ?.QueryTrackingBehavior
              ?? QueryTrackingBehavior.TrackAll;

        _queryTrackingBehavior = _defaultQueryTrackingBehavior;

        StateManager   = stateManager;
        ChangeDetector = changeDetector;
        _model         = (IRuntimeModel)model;
        GraphIterator  = graphIterator;
    }
示例#3
0
 public FakeChangeTracker(
     IStateManager stateManager,
     IChangeDetector changeDetector,
     IEntityEntryGraphIterator graphIterator,
     DbContext context) : base(stateManager, changeDetector, graphIterator, context)
 {
 }
 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;
 }
 /// <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 ChangeTrackerFactory(
     [NotNull] IStateManager stateManager,
     [NotNull] IChangeDetector changeDetector,
     [NotNull] IEntityEntryGraphIterator graphIterator,
     [NotNull] ICurrentDbContext currentContext)
 {
     _stateManager   = stateManager;
     _changeDetector = changeDetector;
     _graphIterator  = graphIterator;
     _context        = currentContext.Context;
 }
 public ChangeTrackerFactory(
     [NotNull] IStateManager stateManager,
     [NotNull] IChangeDetector changeDetector,
     [NotNull] IEntityEntryGraphIterator graphIterator,
     [NotNull] ICurrentDbContext currentContext)
 {
     _stateManager = stateManager;
     _changeDetector = changeDetector;
     _graphIterator = graphIterator;
     _context = currentContext.Context;
 }
示例#7
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(
     ICurrentDbContext currentContext,
     IStateManager stateManager,
     IChangeDetector changeDetector,
     IModel model,
     IEntityEntryGraphIterator graphIterator)
 {
     _context        = currentContext.Context;
     _stateManager   = stateManager;
     _changeDetector = changeDetector;
     _model          = model;
     _graphIterator  = graphIterator;
 }
示例#8
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;
        }
 /// <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 EntityGraphAttacher(
     [NotNull] IEntityEntryGraphIterator graphIterator) => _graphIterator = graphIterator;
示例#11
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 EntityGraphAttacher(
     IEntityEntryGraphIterator graphIterator)
 => _graphIterator = graphIterator;
 /// <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 EntityGraphAttacher([NotNull] IEntityEntryGraphIterator graphIterator)
 {
     _graphIterator = graphIterator;
 }