Пример #1
0
        /// <inheritdoc />
        public async Task DeleteAsync(string query, Dictionary <string, dynamic> bindings = null)
        {
            using var connection = new Connection(ConnectionString);
            await connection.OpenAsync();

            using var command = new Command(query, connection);
            BindParameters(command, bindings);
            await command.ExecuteNonQueryAsync();

            if (Manager.DebugMode)
            {
                Manager.Logger(query);
            }
        }
Пример #2
0
        /// <inheritdoc />
        public async Task <int> InsertAsync(string query, Dictionary <string, dynamic> bindings = null)
        {
            using var connection = new Connection(ConnectionString);
            await connection.OpenAsync();

            using var command = new Command(query, connection);
            BindParameters(command, bindings);
            await command.ExecuteNonQueryAsync();

            if (Manager.DebugMode)
            {
                Manager.Logger(query);
            }

            return(Convert.ToInt32(command.LastInsertedId));
        }