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

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

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

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

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

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