示例#1
0
        public IActionResult Get()
        {
            string singletonLog  = _singletonService.LogRequestToConsole(this.HttpContext);
            string scoppedLog1   = _scoppedService1.Calculate();
            string scoppedLog2   = _scoppedService2.Calculate();
            string transientLog1 = _transientService1.Calculate();
            string transientLog2 = _transientService2.Calculate();


            String result = $"Singleton: {singletonLog}{Environment.NewLine}" +
                            $"Scopped1: {scoppedLog1}{Environment.NewLine}" +
                            $"Scopped2: {scoppedLog2}{Environment.NewLine}" +
                            $"Transient1: {transientLog1}{Environment.NewLine}" +
                            $"Transient2: {transientLog2}";

            return(Ok(result));
        }