solid – c # Manage more repository in UnitOfWork

I have a question about how you can manage multiple repositories with work unit.
I thought of two solutions, but I'm not sure.
The first is a classic solution where the IUnitOfWork interface looks like this:

public interface IUnitOfWork
{
    IUserRepository UserRepository { get; set; }
    IUserSecurity UserSecurityRepository { get; set;}
    IUserHistoryRepository UserHistoryRepository {get; set; }
    void Commit()
}

and its implementation is like this:

public class SqlUnitOfWork : IUnitOfWork
{
    private readonly MyDbContext _dbContext;

    public SqlUnitOfWork(MyDbContext dbContext, IUserRepository userRepository,
    IUserHistoryRepository userHistoryRepository, IUserSecurityRepository userSecurityRepository)
    {
        _dbContext = dbContext;
        UserRepository = userRepository;
        UserHistoryRepository = userHistoryRepository;
        UserSecurityRepository = userSecurityRepository;
    }

    public IUserRepository UserRepository { get; }

    public IUserHistoryRepository UserHistoryRepository { get; }

    public IUserSecurityRepository UserSecurityRepository { get; }

    public void Commit()
    {
        _dbContext.SaveChanges();
    }
}

The second solution I am thinking about is like this:

public interface IUnitOfWork
{
    IRepository GetRepository() where TEntity : class;
    void Commit()
}

and its implementation is:

public class SqlUnitOfWork : IUnitOfWork
{
    private readonly Container _container;

    public SqlUnitOfWork(Container container)
    {
        _container = container;
    }

    public IRepository GetRepository() where TEntity : class
    {
        var repo = _container.GetInstance>();

        if(repo == null)
            throw new ArgumentException("Specified repository is not registered");

        return repo;
    }

    public void Save()
    {
        _container.GetInstance().SaveChanges();
    }
}

In both cases I used the SimpleInjector library as a DI library. In the first case, however, I already have 4 parameters injected into the constructor and if I had to add other user-related repositories (previously UserProfileRepository, etc.) everything would be unmanageable and CodeSmell
The second solution is a bit more prestigious, but I used the container as ServiceLocator and it is considered an AntiPattern. What solution should I choose and how could I improve everything so that everything is a little more SOLID? ?
I hope I was clear. Thank you