示例#1
0
 /// <summary>
 ///     Clones this dependency parameter object with one service replaced.
 /// </summary>
 /// <param name="keyValueIndexFactorySource"> A replacement for the current dependency of this type. </param>
 /// <returns> A new parameter object with the given service replaced. </returns>
 public CommandBatchPreparerDependencies With([NotNull] IKeyValueIndexFactorySource keyValueIndexFactorySource)
 => new CommandBatchPreparerDependencies(
     ModificationCommandBatchFactory,
     ParameterNameGeneratorFactory,
     ModificationCommandComparer,
     keyValueIndexFactorySource,
     StateManager,
     LoggingOptions);
 public CommandBatchPreparer(
     [NotNull] IModificationCommandBatchFactory modificationCommandBatchFactory,
     [NotNull] IParameterNameGeneratorFactory parameterNameGeneratorFactory,
     [NotNull] IComparer <ModificationCommand> modificationCommandComparer,
     [NotNull] IRelationalAnnotationProvider annotations,
     [NotNull] IKeyValueIndexFactorySource keyValueIndexFactoryFactory)
 {
     _modificationCommandBatchFactory = modificationCommandBatchFactory;
     _parameterNameGeneratorFactory   = parameterNameGeneratorFactory;
     _modificationCommandComparer     = modificationCommandComparer;
     _annotationProvider          = annotations;
     _keyValueIndexFactoryFactory = keyValueIndexFactoryFactory;
 }
示例#3
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 CommandBatchPreparer([NotNull] CommandBatchPreparerDependencies dependencies)
        {
            _modificationCommandBatchFactory = dependencies.ModificationCommandBatchFactory;
            _parameterNameGeneratorFactory   = dependencies.ParameterNameGeneratorFactory;
            _modificationCommandComparer     = dependencies.ModificationCommandComparer;
            _keyValueIndexFactorySource      = dependencies.KeyValueIndexFactorySource;
            Dependencies = dependencies;

            if (dependencies.LoggingOptions.IsSensitiveDataLoggingEnabled)
            {
                _sensitiveLoggingEnabled = 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 CommandBatchPreparer(
     [NotNull] IModificationCommandBatchFactory modificationCommandBatchFactory,
     [NotNull] IParameterNameGeneratorFactory parameterNameGeneratorFactory,
     [NotNull] IComparer<ModificationCommand> modificationCommandComparer,
     [NotNull] IRelationalAnnotationProvider annotations,
     [NotNull] IKeyValueIndexFactorySource keyValueIndexFactoryFactory)
 {
     _modificationCommandBatchFactory = modificationCommandBatchFactory;
     _parameterNameGeneratorFactory = parameterNameGeneratorFactory;
     _modificationCommandComparer = modificationCommandComparer;
     _annotationProvider = annotations;
     _keyValueIndexFactoryFactory = keyValueIndexFactoryFactory;
 }
示例#5
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 CommandBatchPreparer([NotNull] CommandBatchPreparerDependencies dependencies)
        {
            _modificationCommandBatchFactory = dependencies.ModificationCommandBatchFactory;
            _parameterNameGeneratorFactory   = dependencies.ParameterNameGeneratorFactory;
            _modificationCommandComparer     = dependencies.ModificationCommandComparer;
            _keyValueIndexFactorySource      = dependencies.KeyValueIndexFactorySource;
            _minBatchSize = dependencies.Options.Extensions.OfType <RelationalOptionsExtension>().FirstOrDefault()
                            ?.MinBatchSize ?? 4;
            Dependencies = dependencies;

            if (dependencies.LoggingOptions.IsSensitiveDataLoggingEnabled)
            {
                _sensitiveLoggingEnabled = true;
            }
        }
示例#6
0
 /// <summary>
 ///     <para>
 ///         Creates the service dependencies parameter object for a <see cref="CommandBatchPreparer" />.
 ///     </para>
 ///     <para>
 ///         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.
 ///     </para>
 ///     <para>
 ///         Do not call this constructor directly from either provider or application code as it may change
 ///         as new dependencies are added. Instead, use this type in your constructor so that an instance
 ///         will be created and injected automatically by the dependency injection container. To create
 ///         an instance with some dependent services replaced, first resolve the object from the dependency
 ///         injection container, then replace selected services using the 'With...' methods. Do not call
 ///         the constructor at any point in this process.
 ///     </para>
 /// </summary>
 public CommandBatchPreparerDependencies(
     [NotNull] IModificationCommandBatchFactory modificationCommandBatchFactory,
     [NotNull] IParameterNameGeneratorFactory parameterNameGeneratorFactory,
     [NotNull] IComparer <ModificationCommand> modificationCommandComparer,
     [NotNull] IKeyValueIndexFactorySource keyValueIndexFactorySource,
     [NotNull] Func <IStateManager> stateManager,
     [NotNull] ILoggingOptions loggingOptions)
 {
     ModificationCommandBatchFactory = modificationCommandBatchFactory;
     ParameterNameGeneratorFactory   = parameterNameGeneratorFactory;
     ModificationCommandComparer     = modificationCommandComparer;
     KeyValueIndexFactorySource      = keyValueIndexFactorySource;
     StateManager   = stateManager;
     LoggingOptions = loggingOptions;
 }
示例#7
0
 /// <summary>
 ///     <para>
 ///         Creates the service dependencies parameter object for a <see cref="CommandBatchPreparer" />.
 ///     </para>
 ///     <para>
 ///         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.
 ///     </para>
 ///     <para>
 ///         Do not call this constructor directly from either provider or application code as it may change
 ///         as new dependencies are added. Instead, use this type in your constructor so that an instance
 ///         will be created and injected automatically by the dependency injection container. To create
 ///         an instance with some dependent services replaced, first resolve the object from the dependency
 ///         injection container, then replace selected services using the 'With...' methods. Do not call
 ///         the constructor at any point in this process.
 ///     </para>
 /// </summary>
 public CommandBatchPreparerDependencies(
     [NotNull] IModificationCommandBatchFactory modificationCommandBatchFactory,
     [NotNull] IParameterNameGeneratorFactory parameterNameGeneratorFactory,
     [NotNull] IComparer <ModificationCommand> modificationCommandComparer,
     [NotNull] IKeyValueIndexFactorySource keyValueIndexFactorySource,
     [NotNull] ILoggingOptions loggingOptions,
     [NotNull] IDiagnosticsLogger <DbLoggerCategory.Update> updateLogger,
     [NotNull] IDbContextOptions options)
 {
     ModificationCommandBatchFactory = modificationCommandBatchFactory;
     ParameterNameGeneratorFactory   = parameterNameGeneratorFactory;
     ModificationCommandComparer     = modificationCommandComparer;
     KeyValueIndexFactorySource      = keyValueIndexFactorySource;
     LoggingOptions = loggingOptions;
     UpdateLogger   = updateLogger;
     Options        = options;
 }
示例#8
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 CommandBatchPreparer(
            [NotNull] IModificationCommandBatchFactory modificationCommandBatchFactory,
            [NotNull] IParameterNameGeneratorFactory parameterNameGeneratorFactory,
            [NotNull] IComparer <ModificationCommand> modificationCommandComparer,
            [NotNull] IKeyValueIndexFactorySource keyValueIndexFactorySource,
            [NotNull] ICurrentDbContext currentContext,
            [NotNull] ILoggingOptions loggingOptions)
        {
            _modificationCommandBatchFactory = modificationCommandBatchFactory;
            _parameterNameGeneratorFactory   = parameterNameGeneratorFactory;
            _modificationCommandComparer     = modificationCommandComparer;
            _keyValueIndexFactorySource      = keyValueIndexFactorySource;
            _currentContext = currentContext;

            if (loggingOptions.IsSensitiveDataLoggingEnabled)
            {
                _sensitiveLoggingEnabled = true;
            }
        }