Esempio n. 1
0
        public IActionResult Index()
        {
            ViewBag.ServiceA = _serviceA.Run();
            ViewBag.ServiceB = _serviceB.Run();
            ViewBag.ServiceC = _serviceC.Run();

            return(View());
        }
Esempio n. 2
0
        protected override void OnStarted()
        {
            _logger.LogInformation("OnStarted has been called. {id}", System.Threading.Thread.CurrentThread.ManagedThreadId);

            using (var scope = _services.CreateScope())
            {
                IServiceA serviceA = scope.ServiceProvider.GetRequiredService <IServiceA>();
                serviceA.Run();
            }
        }
Esempio n. 3
0
        public IActionResult Index2()
        {
            IServiceA serviceA = DependencyResolver.Current.GetService <IServiceA>();
            IServiceB serviceB = DependencyResolver.Current.GetService <IServiceB>();
            IServiceC serviceC = DependencyResolver.Current.GetService <IServiceC>();

            ViewBag.ServiceA = serviceA.Run();
            ViewBag.ServiceB = serviceB.Run();
            ViewBag.ServiceC = serviceC.Run();

            return(View("Index"));
        }
Esempio n. 4
0
        public IActionResult Index()
        {
            InputDTO inputA = new InputDTO();

            inputA.str = "ServiceA";

            ViewBag.ServiceA = _serviceA.Run(inputA);

            InputDTO inputB = new InputDTO();

            inputB.str = "ServiceB";

            ViewBag.ServiceB = _serviceB.Run(inputB);


            InputDTO inputC = new InputDTO();

            inputC.str = "ServiceC";

            ViewBag.ServiceC = _serviceC.Run(inputC);

            return(View());
        }
Esempio n. 5
0
 public void Run()
 {
     _serviceA.Run();
 }