I want to do the following:
- Begin a transaction
- insert data to a database
- After the insert, submits data to an API endpoint with the newly added rows' primary key
- Then commit the transaction
If the insert fails, nothing will be done and everything is rollbacked. The problem is I don't have a good way to rollback the API request if the committing of the transaction fails because it is not a database operation. The only thing I can think of is delete the data from the endpoint. Is there a better way? I am using entity framework. Thanks.