Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Inject Ordering Context rather than Unit Of Work in Transaction Behavior to create Transaction in Db #2157

Open
zakaria-hajeid opened this issue Sep 14, 2023 · 2 comments

Comments

@zakaria-hajeid
Copy link

Hello, I have a question about why you depend on Ordering context in Transaction Behavior To (BeginTransactionAsync)
Why the transaction operation are put in ordering context ? in this case you can use the data access layer in application layer
why not depend on UnitOfWork abstraction to create transaction and manage the transaction ?

issue

@zakaria-hajeid zakaria-hajeid changed the title Inject Ordering Context in Transaction Behavior Inject Ordering Context rather than Unit Of Work in Transaction Behavior to create Transaction in Db Sep 14, 2023
@aymancs85
Copy link

i have the same question

@Vinko90
Copy link

Vinko90 commented Oct 14, 2023

I have the same question as well, would be nice if someone would clarify this. In our company we keep copy-pasting this Transaction behavior in all the repo we have and I don't understand how we can make this generic.

I have a DomainContext which is a generic implementation of the "OrderingContext". So in every domain repository we have, we create a db context and inherit this DomainContext.
However MediatR is not able to resolve the generic DomainContext.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants