public HomeController(IHttpContextAccessor httpContextAccessor, ISingletonService singletonService, IScopedService scopedService, ITransientService transientService)
 {
     _httpContextAccessor = httpContextAccessor;
     _singletonService    = singletonService;
     _scopedService       = scopedService;
     _transientService    = transientService;
 }
Ejemplo n.º 2
0
 public ValuesController(IScopedService scopedService, ITransientService transientService, ISingletonService singletonService, IEnumerable <ICollector> collectors)
 {
     _scopedService    = scopedService;
     _transientService = transientService;
     _singletonService = singletonService;
     _collectors       = collectors;
 }
Ejemplo n.º 3
0
 public TestController(ISingletonService singleton, ITransientService transient, IScopedService scoped, DILifeTimeService dILifeTime)
 {
     _singleton  = singleton;
     _transient  = transient;
     _scoped     = scoped;
     _dILifeTime = dILifeTime;
 }
Ejemplo n.º 4
0
 public HomeController(ILogger <HomeController> logger, ISingletonService singleton, IScopedService scoped, ITransientService transient)
 {
     _logger        = logger;
     this.singleton = singleton;
     this.scoped    = scoped;
     this.transient = transient;
 }
 public AggregateService(IInstanceService instance, IScopedService scoped, ITransientService transient, ISingletonService singleton)
 {
     Instance  = instance;
     Scoped    = scoped;
     Transient = transient;
     Singleton = singleton;
 }
Ejemplo n.º 6
0
        public async Task InvokeAsync(HttpContext context, IScopedService scopedService)
        {
            var singleton = _singletonSvc.GetData();
            var scoped    = scopedService.GetData();

            await context.Response.WriteAsync($"Singleton Data is { singleton }; Scoped Data is { scoped }");
        }
Ejemplo n.º 7
0
        public async Task Invoke(HttpContext httpContext, IScopedService service)
        {
            await httpContext.Response.WriteAsync($"First part of the response, length = {service.Length.ToString()}\n");

            service.Length += 130;
            await _next(httpContext);
        }
Ejemplo n.º 8
0
 public HomeController(ISingletonService singletonService, ITransientService transientService, IScopedService scopedService, IServiceModel servicesModel)
 {
     _singletonService = singletonService;
     _transientService = transientService;
     _scopedService    = scopedService;
     _serviceModel     = servicesModel;
 }
Ejemplo n.º 9
0
 public DemoController(IScopedService scopedService, ITransientService transientService,
                       ISingletonService singletonService)
 {
     _scopedService    = scopedService;
     _transientService = transientService;
     _singletonService = singletonService;
 }
Ejemplo n.º 10
0
 public BigService(ITransientService transientService, IScopedService scopedService,
                   ISingletonService singletonService, ISingletomInstanceService singletomInstanceService)
 {
     TransientService         = transientService;
     ScopedService            = scopedService;
     SingletonService         = singletonService;
     SingletomInstanceService = singletomInstanceService;
 }
 public ServicesController(IScopedService scopedService)
 {
     this.scopedService = scopedService;
     if (this.scopedService != null)
     {
         this.scopedService.Value = "Constructor";
     }
 }
Ejemplo n.º 12
0
 public Demo1Controller(ItransientService s1, ItransientService s2, IScopedService s3, IScopedService s4, ISingletonService s5)
 {
     _service1 = s1;
     _service2 = s2;
     _service3 = s3;
     _service4 = s4;
     _service5 = s5;
 }
 public AnotherDependency(ISingletonService singletonService,
                          IScopedService scopedService,
                          ITransientService transientService)
 {
     this.singletonService = singletonService;
     this.scopedService    = scopedService;
     this.transientService = transientService;
 }
 public TestController(IScopedService scopedService)
 {
     if (scopedService == null)
     {
         throw new ArgumentNullException(nameof(scopedService));
     }
     _scopedService = scopedService;
 }
 public ServicesController(IScopedService scopedService)
 {
     this.scopedService = scopedService;
     if (this.scopedService != null)
     {
         this.scopedService.Value = "Constructor";
     }
 }
Ejemplo n.º 16
0
 public HomeController(IAggregateService aggregateService, ITransientService transientService, IScopedService scopedService, IInstanceService instanceService, ISingletonService singletonService)
 {
     AggregateService = aggregateService;
     TransientService = transientService;
     ScopedService    = scopedService;
     SingletonService = singletonService;
     InstanceService  = instanceService;
 }
 public LifetimeController(ITransientService transientService, IScopedService scopedService,
                           ISingletonService singletonService, ISuperService superService)
 {
     _transientService = transientService;
     _scopedService    = scopedService;
     _singletonService = singletonService;
     _superService     = superService;
 }
 private static ScopedServiceViewModel CreateScopedServiceViewModel(IScopedService scopedService, string name)
 {
     return(new ScopedServiceViewModel
     {
         Name = name,
         ScopedService = scopedService
     });
 }
 public SingletonProcessor(IScopedService scopedService)
 {
     if (scopedService == null)
     {
         throw new ArgumentNullException(nameof(scopedService));
     }
     _scopedService = scopedService;
 }
Ejemplo n.º 20
0
 public HomeController(ILogger <HomeController> logger,
                       IScopedService scoped, ITransientService transient, IExportedService imported = null)
 {
     _logger   = logger;
     Scoped    = scoped;
     Transient = transient;
     Imported  = imported;
 }
Ejemplo n.º 21
0
 public ScopeOrchestration(
     IScopedService scopedService,
     ITransientService transientService, ISingletonService singletonService)
 {
     this.scopedService    = scopedService;
     this.transientService = transientService;
     this.singletonService = singletonService;
 }
Ejemplo n.º 22
0
 public HomeController(
     ISingletonService singleton,
     IScopedService scoped,
     ITransientService transient)
 {
     _singleton = singleton;
     _scoped    = scoped;
     _transient = transient;
 }
Ejemplo n.º 23
0
 public StarterController(ISingletonService singletonService, IScopedService scopedService, ITransientService transientService, IScopedService secondScopedService, ITransientService secondTransientService, IAsyncService asyncService)
 {
     _singletonService       = singletonService;
     _scopedService          = scopedService;
     _transientService       = transientService;
     _secondScopedService    = secondScopedService;
     _secondTransientService = secondTransientService;
     _asyncService           = asyncService;
 }
 public SomeOtherService(
     ITransientService transientService,
     IScopedService scopedService,
     ISingletonService singletonService)
 {
     TransientService = transientService;
     ScopedService    = scopedService;
     SingletonService = singletonService;
 }
Ejemplo n.º 25
0
 public Task Invoke(
     IQueryHandlingContext context,      //Context. Required argument
     IPipe <IQueryHandlingContext> next, //Next filter in pipeline. Required argument,
     IScopedService scopedService        //Scoped dependency. Will be resolved from dependency resolver of current scope.
                                         //Optional argument
     )
 {
     return(next.Send(context));
 }
Ejemplo n.º 26
0
 public Comando1(IScopedService scopeSrv,
                 ITransientService transientSrv,
                 ICustomLogger logger)
 {
     _logger = logger;
     _logger.Log("Instancia Comando1");
     _scopeSrv     = scopeSrv;
     _transientSrv = transientSrv;
 }
Ejemplo n.º 27
0
 public DependencyInjectionController(ITransientService transientService, IScopedService scopedService,
                                      ISingletonService singletonService, ISingletomInstanceService singletomInstanceService, IBigService bigService)
 {
     TransientService         = transientService;
     ScopedService            = scopedService;
     SingletonService         = singletonService;
     SingletomInstanceService = singletomInstanceService;
     BigService = bigService;
 }
 public ValuesController(ITransientService transient1, ITransientService transient2, IScopedService scoped1, IScopedService scoped2, ISingletonService singleton1, ISingletonService singleton2)
 {
     Transient1 = transient1;
     Transient2 = transient2;
     Scoped1    = scoped1;
     Scoped2    = scoped2;
     Singleton1 = singleton1;
     Singleton2 = singleton2;
 }
Ejemplo n.º 29
0
        public HomeController(IConfiguration configuration, ITransientService transientService, ISingletonService singletonService, IScopedService scopedService, ILogger <HomeController> logger)
        {
            _configuration    = configuration;
            _transientService = transientService;
            _scopedService    = scopedService;
            _singletonService = singletonService;

            _logger = logger;
        }
Ejemplo n.º 30
0
 public RandomNumberController(IScopedService scopedService, ISingletonService singletonService,
                               ITransientService transientService, IScopedService scopedService2, ITransientService transientService2)
 {
     _scopedService     = scopedService;
     _singletonService  = singletonService;
     _transientService  = transientService;
     _scopedService2    = scopedService2;
     _transientService2 = transientService2;
 }
 public DemoController(ITransientService sv1, ITransientService sv2, IScopedService sv3, IScopedService sv4, ISingletonService sv5, ISingletonService sv6)
 {
     _sv1 = sv1;
     _sv2 = sv2;
     _sv3 = sv3;
     _sv4 = sv4;
     _sv5 = sv5;
     _sv6 = sv6;
 }
 public ScopedServiceController(IScopedService scopedService)
 {
     this.scopedService = scopedService;
 }
 public ScopedServiceComponent(IScopedService scopedService)
 {
     this.scopedService = scopedService;
 }