1
Vote

Working with transactions

description

Hi,

We have a main entity called "VOB" that it's related to 10 more, we have created a webapi controller to persist the VOB changes in the database, those changes implies changes in the other 10 entities too. To accomplish that we used transactions, one transaction that takes care of 10 possible commit to the database. To make post method shorter we decided to split it in different blocks of code, using different classes, see the pictures attached. As you can see, to keep the transaction we passed the dbContext as a parameter is this a correnct way to accomplish it ?

Thanks.

file attachments

comments