public RelationalSqlExecutor( [NotNull] ISqlStatementExecutor statementExecutor, [NotNull] IRelationalConnection connection, [NotNull] IRelationalTypeMapper typeMapper) { _statementExecutor = statementExecutor; _connection = connection; _typeMapper = typeMapper; }
/// <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 RelationalModelValidator( [NotNull] ILogger<RelationalModelValidator> loggerFactory, [NotNull] IRelationalAnnotationProvider relationalExtensions, [NotNull] IRelationalTypeMapper typeMapper) : base(loggerFactory) { RelationalExtensions = relationalExtensions; TypeMapper = typeMapper; }
public MyQuerySqlGeneratorFactory( IRelationalCommandBuilderFactory commandBuilderFactory, ISqlGenerationHelper sqlGenerationHelper, IParameterNameGeneratorFactory parameterNameGeneratorFactory, IRelationalTypeMapper relationalTypeMapper) : base( commandBuilderFactory, sqlGenerationHelper, parameterNameGeneratorFactory, relationalTypeMapper) { }
protected MigrationsSqlGenerator( [NotNull] IUpdateSqlGenerator sql, [NotNull] IRelationalTypeMapper typeMapper, [NotNull] IRelationalMetadataExtensionProvider annotations) { Check.NotNull(sql, nameof(sql)); Check.NotNull(typeMapper, nameof(typeMapper)); Check.NotNull(annotations, nameof(annotations)); Sql = sql; _typeMapper = typeMapper; _annotations = annotations; }
public BatchExecutor( [NotNull] IRelationalTypeMapper typeMapper, [NotNull] DbContext context, [NotNull] ILoggerFactory loggerFactory) { Check.NotNull(typeMapper, nameof(typeMapper)); Check.NotNull(context, nameof(context)); Check.NotNull(loggerFactory, nameof(loggerFactory)); _typeMapper = typeMapper; _context = context; _logger = new LazyRef<ILogger>(() => (loggerFactory.CreateLogger<BatchExecutor>())); }
public RelationalCommandBuilder( [NotNull] ISensitiveDataLogger logger, [NotNull] DiagnosticSource diagnosticSource, [NotNull] IRelationalTypeMapper typeMapper) { Check.NotNull(logger, nameof(logger)); Check.NotNull(diagnosticSource, nameof(diagnosticSource)); Check.NotNull(typeMapper, nameof(typeMapper)); _logger = logger; _diagnosticSource = diagnosticSource; _typeMapper = typeMapper; }
public RelationalScaffoldingModelFactory( [NotNull] ILoggerFactory loggerFactory, [NotNull] IRelationalTypeMapper typeMapper, [NotNull] IDatabaseModelFactory databaseModelFactory) { Check.NotNull(loggerFactory, nameof(loggerFactory)); Check.NotNull(typeMapper, nameof(typeMapper)); Check.NotNull(databaseModelFactory, nameof(databaseModelFactory)); Logger = loggerFactory.CreateCommandsLogger(); _typeMapper = typeMapper; _databaseModelFactory = databaseModelFactory; }
public DynamicRelationalParameter( [NotNull] string invariantName, [NotNull] string name, [NotNull] IRelationalTypeMapper typeMapper) { Check.NotEmpty(invariantName, nameof(invariantName)); Check.NotEmpty(name, nameof(name)); Check.NotNull(typeMapper, nameof(typeMapper)); InvariantName = invariantName; Name = name; _typeMapper = typeMapper; }
public MigrationsSqlGenerator( [NotNull] IRelationalCommandBuilderFactory commandBuilderFactory, [NotNull] ISqlGenerator sqlGenerator, [NotNull] IRelationalTypeMapper typeMapper, [NotNull] IRelationalAnnotationProvider annotations) { Check.NotNull(commandBuilderFactory, nameof(commandBuilderFactory)); Check.NotNull(sqlGenerator, nameof(sqlGenerator)); Check.NotNull(typeMapper, nameof(typeMapper)); Check.NotNull(annotations, nameof(annotations)); _commandBuilderFactory = commandBuilderFactory; SqlGenerator = sqlGenerator; _typeMapper = typeMapper; _annotations = annotations; }
/// <summary> /// Creates a new instance of <see cref="SqlTranslatingExpressionVisitorFactory" />. /// </summary> /// <param name="relationalAnnotationProvider"> The relational annotation provider. </param> /// <param name="compositeExpressionFragmentTranslator"> The composite expression fragment translator. </param> /// <param name="methodCallTranslator"> The method call translator. </param> /// <param name="memberTranslator"> The member translator. </param> /// <param name="relationalTypeMapper"> The relational type mapper. </param> public SqlTranslatingExpressionVisitorFactory( [NotNull] IRelationalAnnotationProvider relationalAnnotationProvider, [NotNull] IExpressionFragmentTranslator compositeExpressionFragmentTranslator, [NotNull] IMethodCallTranslator methodCallTranslator, [NotNull] IMemberTranslator memberTranslator, [NotNull] IRelationalTypeMapper relationalTypeMapper) { Check.NotNull(relationalAnnotationProvider, nameof(relationalAnnotationProvider)); Check.NotNull(compositeExpressionFragmentTranslator, nameof(compositeExpressionFragmentTranslator)); Check.NotNull(methodCallTranslator, nameof(methodCallTranslator)); Check.NotNull(memberTranslator, nameof(memberTranslator)); Check.NotNull(relationalTypeMapper, nameof(relationalTypeMapper)); _relationalAnnotationProvider = relationalAnnotationProvider; _compositeExpressionFragmentTranslator = compositeExpressionFragmentTranslator; _methodCallTranslator = methodCallTranslator; _memberTranslator = memberTranslator; _relationalTypeMapper = relationalTypeMapper; }
public RelationalForeignKeyAttributeConvention([NotNull] IRelationalTypeMapper typeMapper) { Check.NotNull(typeMapper, nameof(typeMapper)); _typeMapper = typeMapper; }
public FakeQueryCompilationContext( IModel model, ILogger logger, ILinqOperatorProvider linqOperatorProvider, IResultOperatorHandler resultOperatorHandler, IEntityMaterializerSource entityMaterializerSource, IClrAccessorSource<IClrPropertyGetter> clrPropertyGetterSource, IEntityKeyFactorySource entityKeyFactorySource, IQueryMethodProvider queryMethodProvider, IMethodCallTranslator compositeMethodCallTranslator, IMemberTranslator compositeMemberTranslator, IRelationalValueBufferFactoryFactory valueBufferFactoryFactory, IRelationalTypeMapper typeMapper, IRelationalMetadataExtensionProvider relationalExtensions) : base( model, logger, linqOperatorProvider, resultOperatorHandler, entityMaterializerSource, entityKeyFactorySource, clrPropertyGetterSource, queryMethodProvider, compositeMethodCallTranslator, compositeMemberTranslator, valueBufferFactoryFactory, typeMapper, relationalExtensions) { }
protected override DbCommand CreateStoreCommand(string commandText, DbTransaction transaction, IRelationalTypeMapper typeMapper, int?commandTimeout) { GlobalCommandTimeout = commandTimeout; return(base.CreateStoreCommand(commandText, transaction, typeMapper, commandTimeout)); }
public override async Task<int> ExecuteAsync( RelationalTransaction transaction, IRelationalTypeMapper typeMapper, DbContext context, ILogger logger, CancellationToken cancellationToken = default(CancellationToken)) { Check.NotNull(transaction, nameof(transaction)); Check.NotNull(typeMapper, nameof(typeMapper)); Check.NotNull(context, nameof(context)); Check.NotNull(logger, nameof(logger)); var commandText = GetCommandText(); Debug.Assert(ResultSetEnds.Count == ModificationCommands.Count); var commandIndex = 0; using (var storeCommand = CreateStoreCommand(commandText, transaction.DbTransaction, typeMapper, transaction.Connection?.CommandTimeout)) { if (logger.IsEnabled(LogLevel.Verbose)) { logger.LogCommand(storeCommand); } try { using (var reader = await storeCommand.ExecuteReaderAsync(cancellationToken)) { var actualResultSetCount = 0; do { commandIndex = ModificationCommands[commandIndex].RequiresResultPropagation ? await ConsumeResultSetWithPropagationAsync(commandIndex, reader, context, cancellationToken) : await ConsumeResultSetWithoutPropagationAsync(commandIndex, reader, context, cancellationToken); actualResultSetCount++; } while (commandIndex < ResultSetEnds.Count && await reader.NextResultAsync(cancellationToken)); Debug.Assert(commandIndex == ModificationCommands.Count, "Expected " + ModificationCommands.Count + " results, got " + commandIndex); #if DEBUG var expectedResultSetCount = 1 + ResultSetEnds.Count(e => e); expectedResultSetCount += ResultSetEnds[ResultSetEnds.Count - 1] ? -1 : 0; Debug.Assert(actualResultSetCount == expectedResultSetCount, "Expected " + expectedResultSetCount + " result sets, got " + actualResultSetCount); #endif } } catch (DbUpdateException) { throw; } catch (Exception ex) { throw new DbUpdateException( Strings.UpdateStoreException, context, ex, commandIndex < ModificationCommands.Count ? ModificationCommands[commandIndex].Entries : new InternalEntityEntry[0]); } } return commandIndex; }
public RelationalCommandBuilder([NotNull] IRelationalTypeMapper typeMapper) { Check.NotNull(typeMapper, nameof(typeMapper)); _typeMapper = typeMapper; }
/// <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 RelationalParameterBuilder([NotNull] IRelationalTypeMapper typeMapper) { Check.NotNull(typeMapper, nameof(typeMapper)); TypeMapper = typeMapper; }
public FakeRelationalDatabase( IModel model, IEntityKeyFactorySource entityKeyFactorySource, IEntityMaterializerSource entityMaterializerSource, IClrAccessorSource<IClrPropertyGetter> clrPropertyGetterSource, IRelationalConnection connection, ICommandBatchPreparer batchPreparer, IBatchExecutor batchExecutor, IDbContextOptions options, ILoggerFactory loggerFactory, IRelationalValueBufferFactoryFactory valueBufferFactoryFactory, IMethodCallTranslator compositeMethodCallTranslator, IMemberTranslator compositeMemberTranslator, IRelationalTypeMapper typeMapper) : base( model, entityKeyFactorySource, entityMaterializerSource, clrPropertyGetterSource, connection, batchPreparer, batchExecutor, options, loggerFactory, valueBufferFactoryFactory, compositeMethodCallTranslator, compositeMemberTranslator, typeMapper) { }
public void PopulateParametersBase(DbCommand command, ColumnModification columnModification, IRelationalTypeMapper typeMapper) { base.PopulateParameters(command, columnModification, typeMapper); }
public FbCommandBuilder(IDiagnosticsLogger <DbLoggerCategory.Database.Command> logger, IRelationalTypeMapper typeMapper) { _logger = logger; ParameterBuilder = new RelationalParameterBuilder(typeMapper); }
public NpgsqlMigrationsModelDiffer([NotNull] IRelationalTypeMapper typeMapper, [NotNull] IRelationalAnnotationProvider annotations, [NotNull] IMigrationsAnnotationProvider migrationsAnnotations) : base(typeMapper, annotations, migrationsAnnotations) { }
public MigrationsSqlGenerator(IRelationalCommandBuilderFactory commandBuilderFactory, ISqlGenerationHelper sqlGenerationHelper, IRelationalTypeMapper typeMapper, IRelationalAnnotationProvider annotations) { Check.NotNull(commandBuilderFactory, nameof(commandBuilderFactory)); Check.NotNull(sqlGenerationHelper, nameof(sqlGenerationHelper)); Check.NotNull(typeMapper, nameof(typeMapper)); Check.NotNull(annotations, nameof(annotations)); _commandBuilderFactory = commandBuilderFactory; SqlGenerationHelper = sqlGenerationHelper; TypeMapper = typeMapper; Annotations = annotations; }
public RelationalPropertyMappingValidationConvention([NotNull] IRelationalTypeMapper typeMapper) { Check.NotNull(typeMapper, nameof(typeMapper)); _typeMapper = typeMapper; }
public MySQLScaffoldingModelFactory(ILoggerFactory loggerFactory, IRelationalTypeMapper typeMapper, IDatabaseModelFactory databaseModelFactory, CandidateNamingService candidateNamingService) : base(loggerFactory, typeMapper, databaseModelFactory, candidateNamingService) { }
/// <summary> /// This is internal functionality and not intended for public use. /// </summary> public SpannerModificationCommandBatch(IRelationalTypeMapper typeMapper, IDiagnosticsLogger <DbLoggerCategory.Database.Command> logger) { _typeMapper = typeMapper; _logger = logger; }
public RelationalInversePropertyAttributeConvention([NotNull] IRelationalTypeMapper typeMapper) { Check.NotNull(typeMapper, nameof(typeMapper)); _typeMapper = typeMapper; }
protected virtual IRelationalCommandBuilder CreateCore( [NotNull] IDiagnosticsLogger <DbLoggerCategory.Database.Command> logger, [NotNull] IRelationalTypeMapper relationalTypeMapper) => new FbCommandBuilder( logger, relationalTypeMapper);
public SqlCeConventionSetBuilder([NotNull] IRelationalTypeMapper typeMapper) : base(typeMapper) { }
protected virtual IRelationalCommandBuilder CreateCore(IDiagnosticsLogger <DbLoggerCategory.Database.Command> logger, IRelationalTypeMapper relationalTypeMapper) { return(new FbCommandBuilder(logger, relationalTypeMapper)); }
/// <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 RelationalTypeMappingConvention([NotNull] IRelationalTypeMapper typeMapper) => _typeMapper = typeMapper;
/// <summary> /// Clones this dependency parameter object with one service replaced. /// </summary> /// <param name="typeMapper"> A replacement for the current dependency of this type. </param> /// <returns> A new parameter object with the given service replaced. </returns> public RelationalModelValidatorDependencies With([NotNull] IRelationalTypeMapper typeMapper) => new RelationalModelValidatorDependencies(RelationalExtensions, typeMapper);
public RelationalInversePropertyAttributeConvention([NotNull] IRelationalTypeMapper typeMapper) { Check.NotNull(typeMapper, nameof(typeMapper)); _typeMapper = typeMapper; }
public BatchExecutorForTest(IRelationalTypeMapper typeMapper) : base(typeMapper, TestHelpers.Instance.CreateContext(), new LoggerFactory()) { }
public NpgsqlModelValidator([NotNull] ILogger <RelationalModelValidator> loggerFactory, [NotNull] IRelationalAnnotationProvider relationalExtensions, [NotNull] IRelationalTypeMapper typeMapper) : base(loggerFactory, relationalExtensions, typeMapper) { _relationalExtensions = relationalExtensions; }
public RelationalCommandBuilderFactory([NotNull] IRelationalTypeMapper typeMapper) { Check.NotNull(typeMapper, nameof(typeMapper)); _typeMapper = typeMapper; }
public SqlServerUpdateSqlGenerator([NotNull] ISqlGenerationHelper sqlGenerationHelper, [NotNull] IRelationalTypeMapper typeMapper) : base(sqlGenerationHelper) { _typeMapper = typeMapper; }
protected virtual void PopulateParameters(DbCommand command, ColumnModification columnModification, IRelationalTypeMapper typeMapper) { if (columnModification.ParameterName != null || columnModification.OriginalParameterName != null) { var property = columnModification.Property; var isKey = columnModification.IsKey || property.IsKey() || property.IsForeignKey(); // TODO: It would be nice to just pass IProperty to the type mapper, but Migrations uses its own // store model for which there is no easy way to get an IProperty. // Issue #769 var extensions = _metadataExtensionProvider.Extensions(property); var typeMapping = typeMapper .GetTypeMapping(extensions.ColumnType, extensions.Column, property.ClrType, isKey, property.IsConcurrencyToken); if (columnModification.ParameterName != null) { command.Parameters.Add(typeMapping.CreateParameter(command, columnModification, false)); } if (columnModification.OriginalParameterName != null) { command.Parameters.Add(typeMapping.CreateParameter(command, columnModification, true)); } } }
public ConcreteMigrationSqlGenerator( IRelationalCommandBuilderFactory commandBuilderFactory, ISqlGenerationHelper sqlGenerationHelper, IRelationalTypeMapper typeMapper, IRelationalAnnotationProvider annotations) : base(commandBuilderFactory, sqlGenerationHelper, typeMapper, annotations) { }
public TestConventionalSetBuilder(IRelationalTypeMapper typeMapper, ICurrentDbContext currentContext, IDbSetFinder setFinder) : base(typeMapper, currentContext, setFinder) { }
public ConcreteMigrationSqlGenerator( IUpdateSqlGenerator sqlGenerator, IRelationalTypeMapper typeMapper, IRelationalMetadataExtensionProvider annotations) : base(sqlGenerator, typeMapper, annotations) { }
/// <summary> /// Clones this dependency parameter object with one service replaced. /// </summary> /// <param name="typeMapper"> A replacement for the current dependency of this type. </param> /// <returns> A new parameter object with the given service replaced. </returns> public MigrationsSqlGeneratorDependencies With([NotNull] IRelationalTypeMapper typeMapper) => new MigrationsSqlGeneratorDependencies( CommandBuilderFactory, SqlGenerationHelper, typeMapper);
public RelationalModelValidatorDependencies With([NotNull] IRelationalTypeMapper typeMapper) => new RelationalModelValidatorDependencies(typeMapper, TypeMappingSource);
/// <summary> /// Clones this dependency parameter object with one service replaced. /// </summary> /// <param name="typeMapper"> 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] IRelationalTypeMapper typeMapper) => new RelationalConventionSetBuilderDependencies(typeMapper, Context, SetFinder);
public RelationalRelationshipDiscoveryConvention([NotNull] IRelationalTypeMapper typeMapper) { Check.NotNull(typeMapper, nameof(typeMapper)); _typeMapper = typeMapper; }
public BatchExecutorForTest(IRelationalTypeMapper typeMapper) : base(typeMapper, TestHelpers.Instance.CreateContext(), new LoggerFactory()) { }
public DbCommand CreateStoreCommandBase(string commandText, DbTransaction transaction, IRelationalTypeMapper typeMapper, int? commandTimeout) { return base.CreateStoreCommand(commandText, transaction, typeMapper, commandTimeout); }
protected override IRelationalCommandBuilder CreateCore( IDiagnosticsLogger <DbLoggerCategory.Database.Command> logger, IRelationalTypeMapper relationalTypeMapper) => new OracleRelationalCommandBuilder(logger, relationalTypeMapper);
public RelationalPropertyDiscoveryConvention([NotNull] IRelationalTypeMapper typeMapper) { Check.NotNull(typeMapper, nameof(typeMapper)); _typeMapper = typeMapper; }
public OracleRelationalCommandBuilder( IDiagnosticsLogger <DbLoggerCategory.Database.Command> logger, IRelationalTypeMapper typeMapper) : base(logger, typeMapper) { }
/// <summary> /// Clones this dependency parameter object with one service replaced. /// </summary> /// <param name="typeMapper"> A replacement for the current dependency of this type. </param> /// <returns> A new parameter object with the given service replaced. </returns> public RelationalValueBufferFactoryDependencies With([NotNull] IRelationalTypeMapper typeMapper) => new RelationalValueBufferFactoryDependencies(typeMapper);
public RelationalForeignKeyAttributeConvention([NotNull] IRelationalTypeMapper typeMapper) { Check.NotNull(typeMapper, nameof(typeMapper)); _typeMapper = typeMapper; }
protected override IRelationalCommandBuilder CreateCore( [NotNull] IDiagnosticsLogger <DbLoggerCategory.Database.Command> logger, [NotNull] IRelationalTypeMapper relationalTypeMapper) { return(new MySQLCommandBuilder(_logger, _typeMapper)); }
protected override DbCommand CreateStoreCommand(string commandText, DbTransaction transaction, IRelationalTypeMapper typeMapper, int? commandTimeout) { return CreateDbCommandMock(_reader).Object; }
public abstract void Execute( [NotNull] IRelationalTransaction transaction, [NotNull] IRelationalTypeMapper typeMapper, [NotNull] DbContext context, [NotNull] ILogger logger);
protected override void PopulateParameters(DbCommand command, ColumnModification columnModification, IRelationalTypeMapper typeMapper) { PopulateParameterCalls++; }
public abstract Task ExecuteAsync( [NotNull] IRelationalTransaction transaction, [NotNull] IRelationalTypeMapper typeMapper, [NotNull] DbContext context, [NotNull] ILogger logger, CancellationToken cancellationToken = default(CancellationToken));
public RelationalPropertyMappingValidationConvention([NotNull] IRelationalTypeMapper typeMapper) { Check.NotNull(typeMapper, nameof(typeMapper)); _typeMapper = typeMapper; }
public FbCommandBuilderFactory(IDiagnosticsLogger <DbLoggerCategory.Database.Command> logger, IRelationalTypeMapper typeMapper) { _logger = logger; _typeMapper = typeMapper; }