Esempio n. 1
0
        public void Setup()
        {
            //setup our DI
            var serviceProvider = new ServiceCollection()
                                  .AddLogging()
                                  .AddSingleton <ITollRepository, TollRepository>()
                                  .AddTransient <ITollService, TollService>()
                                  .BuildServiceProvider();

            //configure console logging
            serviceProvider
            .GetService <ILoggerFactory>();

            _tollService    = serviceProvider.GetService <ITollService>();
            _tollRepository = serviceProvider.GetService <ITollRepository>();
        }
Esempio n. 2
0
 public TollService(ITollRepository tollRepository)
 {
     _tollRepository = tollRepository;
 }