79244114

Date: 2024-12-02 12:41:37
Score: 0.5
Natty:
Report link

No, it is not required to call .Rollback() or .RollbackAsync() if you are disposing of the transaction without committing it.

From the official docs (https://learn.microsoft.com/en-us/ef/core/saving/transactions):

Commit transaction if all commands succeed, transaction will auto-rollback when disposed if either commands fails

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: blackforest-tom