Beispiel #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>();
        }
 public TollCalculations(ITollService tollService)
 {
     _tollService = tollService;
 }
 public TollController(IMapper mapper, ITollService tollService, ITollCalulations tollCalulations)
 {
     _mapper           = mapper;
     _tollService      = tollService;
     _tollCalculations = tollCalulations;
 }
 public TollFeeController(ITollService tollService)
 {
     _tollService = tollService;
 }