Пример #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>();
        }
Пример #2
0
 public TollCalculations(ITollService tollService)
 {
     _tollService = tollService;
 }
Пример #3
0
 public TollController(IMapper mapper, ITollService tollService, ITollCalulations tollCalulations)
 {
     _mapper           = mapper;
     _tollService      = tollService;
     _tollCalculations = tollCalulations;
 }
 public TollFeeController(ITollService tollService)
 {
     _tollService = tollService;
 }