Skip to content
Discussion options

You must be logged in to vote

Thanks for the context @codescratchers.

Now that you mentioned it, I should have used an HTTP handler to demonstrate what I meant because that's where this is typically useful.

In the video, I recommend the opposite: not using context to include the transaction but rather refactoring the underlying code that happens to need a transaction to use another type (the "transaction script") to drive this logic, to reuse existing repositories that can support transactions if required.

See UserCloner.Clone, this method drives the transaction not the layers above it (like an HTTP handler). If you see the code for the used types (example User) you will notice they refer to the DBTX type so in practi…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@codescratchers
Comment options

@codescratchers
Comment options

@MarioCarrion
Comment options

MarioCarrion Aug 30, 2024
Maintainer Author

Answer selected by MarioCarrion
@codescratchers
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants