Unit of Work design pattern
The Unit of Work design pattern solves the problem, that other components / layers in your software then the persistency layer needs to keep track on which data needs to be inserted, updated or deleted. Also this pattern makes sure that all the data is saved within one transaction.