I want to have DbContext in a function from the pool during a using scope
I already tried to add IServiceProvider to the factory and let the factory resolve the context and put it into a UoW but then it tells me the same contains is used in other threads.
services.AddDbContextPool<EmployeeContext>(options => options.UseSqlServer(connection));
...
using (var unitOfWork = factory.CreateUnitOfWork())
{
}
I want to create a unit-of-work scope within a function which is using the DbContextPool of dependency injection.