Ejemplo n.º 1
0
        public async Task <IActionResult> Index()
        {
            using (var client = new HttpClient())
            {
                try
                {
                    client.BaseAddress = new Uri("http://localhost:5000");
                    string url = $"api/project";
                    ViewData["projects"] = await _projectFactory.MapToList(client, url);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                    throw;
                }
            }

            return(View());
        }