public TestDatabaseCreator(
     RelationalDatabaseCreatorDependencies dependencies,
     IMySqlConnection connection,
     IRawSqlCommandBuilder rawSqlCommandBuilder)
     : base(dependencies, connection, rawSqlCommandBuilder)
 {
 }
Exemplo n.º 2
0
        public MySqlCheckpointManager(IMySqlConnection connection, ILogger <MySqlCheckpointManager> logger)
        {
            _logger  = logger ?? throw new ArgumentNullException(nameof(logger));
            _scripts = new Scripts.Scripts();

            _createConnection = connection.Build;
        }
 /// <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 MySqlDatabaseCreator(
     [NotNull] RelationalDatabaseCreatorDependencies dependencies,
     [NotNull] IMySqlConnection connection,
     [NotNull] IRawSqlCommandBuilder rawSqlCommandBuilder)
     : base(dependencies)
 {
     _connection           = connection;
     _rawSqlCommandBuilder = rawSqlCommandBuilder;
 }
Exemplo n.º 4
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 MySqlValueGeneratorSelector(
            [NotNull] ValueGeneratorSelectorDependencies dependencies,
            [NotNull] IMySqlSequenceValueGeneratorFactory sequenceFactory,
            [NotNull] IMySqlConnection connection)
            : base(dependencies)
        {
            Check.NotNull(sequenceFactory, nameof(sequenceFactory));
            Check.NotNull(connection, nameof(connection));

            _sequenceFactory = sequenceFactory;
            _connection      = connection;
        }
        /// <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 MySqlSequenceHiLoValueGenerator(
            [NotNull] IRawSqlCommandBuilder rawSqlCommandBuilder,
            [NotNull] IMySqlUpdateSqlGenerator sqlGenerator,
            [NotNull] MySqlSequenceValueGeneratorState generatorState,
            [NotNull] IMySqlConnection connection)
            : base(generatorState)
        {
            Check.NotNull(rawSqlCommandBuilder, nameof(rawSqlCommandBuilder));
            Check.NotNull(sqlGenerator, nameof(sqlGenerator));
            Check.NotNull(connection, nameof(connection));

            _sequence             = generatorState.Sequence;
            _rawSqlCommandBuilder = rawSqlCommandBuilder;
            _sqlGenerator         = sqlGenerator;
            _connection           = connection;
        }
        /// <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 virtual ValueGenerator Create(IProperty property, MySqlSequenceValueGeneratorState generatorState, IMySqlConnection connection)
        {
            Check.NotNull(property, nameof(property));
            Check.NotNull(generatorState, nameof(generatorState));
            Check.NotNull(connection, nameof(connection));

            var type = property.ClrType.UnwrapNullableType().UnwrapEnumType();

            if (type == typeof(long))
            {
                return(new MySqlSequenceHiLoValueGenerator <long>(_rawSqlCommandBuilder, _sqlGenerator, generatorState, connection));
            }

            if (type == typeof(int))
            {
                return(new MySqlSequenceHiLoValueGenerator <int>(_rawSqlCommandBuilder, _sqlGenerator, generatorState, connection));
            }

            if (type == typeof(short))
            {
                return(new MySqlSequenceHiLoValueGenerator <short>(_rawSqlCommandBuilder, _sqlGenerator, generatorState, connection));
            }

            if (type == typeof(byte))
            {
                return(new MySqlSequenceHiLoValueGenerator <byte>(_rawSqlCommandBuilder, _sqlGenerator, generatorState, connection));
            }

            if (type == typeof(char))
            {
                return(new MySqlSequenceHiLoValueGenerator <char>(_rawSqlCommandBuilder, _sqlGenerator, generatorState, connection));
            }

            if (type == typeof(ulong))
            {
                return(new MySqlSequenceHiLoValueGenerator <ulong>(_rawSqlCommandBuilder, _sqlGenerator, generatorState, connection));
            }

            if (type == typeof(uint))
            {
                return(new MySqlSequenceHiLoValueGenerator <uint>(_rawSqlCommandBuilder, _sqlGenerator, generatorState, connection));
            }

            if (type == typeof(ushort))
            {
                return(new MySqlSequenceHiLoValueGenerator <ushort>(_rawSqlCommandBuilder, _sqlGenerator, generatorState, connection));
            }

            if (type == typeof(sbyte))
            {
                return(new MySqlSequenceHiLoValueGenerator <sbyte>(_rawSqlCommandBuilder, _sqlGenerator, generatorState, connection));
            }

            throw new ArgumentException(
                      CoreStrings.InvalidValueGeneratorFactoryProperty(
                          nameof(MySqlSequenceValueGeneratorFactory), property.Name, property.DeclaringEntityType.DisplayName()));
        }
Exemplo n.º 7
0
 public JobRepository(IMySqlConnection connection)
 {
     _connection = connection.GetConnection();
 }
 public GameRepository(IMySqlConnection mySqlConnection)
 {
     this.mySqlConnection = mySqlConnection;
 }
Exemplo n.º 9
0
 public ClientRepository(IMySqlConnection connection)
 {
     _connection = connection.GetConnection();
 }