Create new instance of class on calling a method c# : I have a Console Application which is injecting all the service through the constructor. I am also creating and initializing a Dictionary in the Constructor of my data access class.

I am calling the data access method from my main class but I wanted to create a new instance of data access class and therefore dictionary whenever I will call the method GetData().



    public class Startup
    {
        private static void Main(string[] args)
        {
            
            ServiceCollection serviceCollection = new ServiceCollection();
            ConfigureServices(serviceCollection);
            IServiceProvider serviceProvider = serviceCollection.BuildServiceProvider();
            serviceProvider.GetService<MyService>().Start();
        }

        
        private static void ConfigureServices(IServiceCollection serviceCollection)
        {
            serviceCollection.AddTransient<IMyServiceDataAccess, MyServiceDataAccess>();
            serviceCollection.AddTransient<MyService>();
        }
     }


MyServiceClass:

        private readonly IMyServiceDataAccess _dataAccess;
        public MyService(IMyServiceDataAccess dataAccess)
        {
            _dataAccess = dataAccess;
        }

        public void Start()
        {

             var data = _dataAccess.GetData();
        }

DataAccess interface
 
       public interface IMyServiceDataAccess
       {
          List<int> GetData();
       }


DataAccess class:


        Dictionary<bool,List<int> dict;
        public MyServiceDataAccess()
        {
            dict = new Dictionary<bool,List<int>>()
        }

        public List<int> GetData()
        {
          // have to access the above dict and everytime I need new instance 
          // of this dict
        }


This will be multithreaded application so multiple threads can share the dictionary. One way is that create new instance of dictionary in get data method everytime it is called.

Any help?