public DefaultScopedService2(ISampleSingletonService singletonService, ISampleTransientService1 transient1, ISampleTransientService2 transient2) { this.InstanceId = Interlocked.Increment(ref _idSeed); this.SingletonService = singletonService ?? throw new ArgumentNullException(nameof(singletonService)); this.Transient1 = transient1 ?? throw new ArgumentNullException(nameof(transient1)); this.Transient2 = transient2 ?? throw new ArgumentNullException(nameof(transient2)); }
public LifetimeServicesController(ILogger <LifetimeServicesController> logger, IConfiguration Configuration, IOptions <ApplicationSettings> applicationSettings, ISampleTransientService sampleTransientService, ISampleSingletonService sampleSingletonService, ISampleScopedService sampleScopedService) { _logger = logger; _config = Configuration; _applicationSettings = applicationSettings.Value; _sampleTransientService = sampleTransientService; _sampleSingletonService = sampleSingletonService; _sampleScopedService = sampleScopedService; }
public ValuesController( ISampleSingletonService sgl, ISampleScopedService1 sc1, ISampleScopedService2 sc2, ISampleTransientService1 st1, ISampleTransientService2 st2 ) { this.sgl = sgl ?? throw new ArgumentNullException(nameof(sgl)); this.sc1 = sc1 ?? throw new ArgumentNullException(nameof(sc1)); this.sc2 = sc2 ?? throw new ArgumentNullException(nameof(sc2)); this.st1 = st1 ?? throw new ArgumentNullException(nameof(st1)); this.st2 = st2 ?? throw new ArgumentNullException(nameof(st2)); }
public DefaultTransientService2(ISampleSingletonService singleton) { this.InstanceId = Interlocked.Increment(ref _idSeed); this.SingletonDependency = singleton; }
public Service1(ISampleSingletonService sg1, ISampleTransientService2 st2) { this.sg1 = sg1 ?? throw new ArgumentNullException(nameof(sg1)); this.st2 = st2 ?? throw new ArgumentNullException(nameof(st2)); }