I am using the below Unit of work implementation in my application. URL reference :How to implement Unit Of Work pattern with Dapper?
This is working fine with single thread application. But if i want to use same code for multi thread application, then its creating a problem.
Example:
I am creating unit of work object with AddScoped
services.AddScoped<IUnitOfWork, UnitOfWork>();
Old Transaction object will be replaced by new transaction object, when more than one thread calling unit of work Begin() method in single web request.