Example #1
0
 public CustomService(ISampleTransient transient,
                      ISampleScoped scoped,
                      ISampleSingleton singleton)
 {
     Transient = transient;
     Scoped    = scoped;
     Singleton = singleton;
 }
Example #2
0
        //public HomeController(ILogger<HomeController> logger)
        //{
        //    _logger = logger;
        //}

        public HomeController(ISampleTransient transient,
                              ISampleScoped scoped,
                              ISampleSingleton singleton)
        {
            _transient = transient;
            _scoped    = scoped;
            _singleton = singleton;
        }
Example #3
0
 public InjectionService(ISampleTransient transient,
                         ISampleScoped scoped,
                         ISampleSingleton singleton)
 {
     Transient = transient;
     Scoped    = scoped;
     Singleton = singleton;
 }
 public SampleService(ISampleTransient sampleTransient,
                      ISampleScoped sampleScoped,
                      ISampleSingleton sampleSingleton)
 {
     SampleTransient = sampleTransient;
     SampleScoped    = sampleScoped;
     SampleSingleton = sampleSingleton;
 }
Example #5
0
        public HomeController(ILogger <HomeController> logger,
                              ISampleTransient transientService,
                              ISampleScoped scopedService,
                              ISampleSingleton singletonService,
                              IEnumerable <IPayService> payServices)
        {
            _logger           = logger;
            _transientService = transientService;
            _scopedService    = scopedService;
            _singletonService = singletonService;

            // One interface with multiple service.
            _PayServices = payServices;
        }
Example #6
0
 public HomeController(ISampleTransient sampleTransient, ISampleScoped sampleScoped, ISampleSingleton sampleSingleton)
 {
     _sampleTransient = sampleTransient;
     _sampleScoped    = sampleScoped;
     _sampleSingleton = sampleSingleton;
 }