applyChangesToDb

inline fun <T> ToMany<T>.applyChangesToDb(resetFirst: Boolean = false, body: ToMany<T>.() -> Unit)

Allows making changes (adding and removing entities) to this ToMany with a call to apply the changes to the database. Can reset the ToMany before making changes.

toMany.applyChangesToDb {
add(entity)
}