Esempio n. 1
0
        public IActionResult Get()
        {
            try
            {
                return(_responseHandler.Get(_helloWorldService.GetHelloWorld()));
            }
            catch (Exception ex)
            {
                // log the exception
                _logger.LogError(ex, "An error has occurred in HelloWorld");

                // return 500, obscure the exception from the caller
                return(StatusCode(StatusCodes.Status500InternalServerError));
            }
        }
Esempio n. 2
0
        public void Run()
        {
            var helloWorld = _helloWorldService.GetHelloWorld();

            Console.WriteLine(helloWorld);
        }
Esempio n. 3
0
        public async Task RunAsync()
        {
            var helloWorld = await _helloWorldService.GetHelloWorld();

            Console.WriteLine(helloWorld);
        }
Esempio n. 4
0
 public IActionResult Get()
 {
     return(Ok(helloWorldService.GetHelloWorld()));
 }
Esempio n. 5
0
        public async Task <HelloWorldModel> Get()
        {
            HelloWorldModel helloWorld = await helloWorldService.GetHelloWorld();

            return(helloWorld);
        }