Пример #1
0
        /// <summary>
        /// Method to write the information from API to different destinations
        /// </summary>
        public void DisplayMessage()
        {
            switch (ConfigurationManager.AppSettings.Get("outputType"))
            {
            case "console":
                Console.WriteLine(_service.GetMessage(ConfigurationManager.AppSettings.Get("HelloWorldApiUrl")).Result);
                break;

            case "database":
                _service.InsertMessageIntoDatabase(ConfigurationManager.ConnectionStrings["DBConnectionString"].ConnectionString);
                break;

            default:
                Console.WriteLine("The write method specified is not supported by this application");
                break;
            }
        }
Пример #2
0
        public IActionResult Get()
        {
            var msg = _helloWorldService.GetMessage();

            return(Ok(msg));
        }
Пример #3
0
 public ActionResult <string> Get()
 {
     return(_helloWorldService.GetMessage());
 }