❔ How to use BeginTransaction in repository from infrastructure
I have this code in CommandHandler (Application layer):
Repository (Infrastructure layer):
Interface repo (Domain layer):
I don't want to use IDbContextTransaction in the domain layer because it uses a reference to Microsoft.EntityFrameworkCore.Storage and I would like to avoid such in this layer. Is there any neat way to use BeginTransaction in some repository? I also don't want to directly apply dbContext in my CommandHandler, but do this by infrastructure layer
2 Replies