Esempio n. 1
0
        // GET: Products
        public IActionResult Index()
        {
            _logger.LogInformation("\nEn person " + GetIpAddress.GetIPAddress() + " har besøgt produkt siden!\n");

            byte[] myDataBuffer     = webClient.DownloadData(urlApi);
            string downloadedString = Encoding.UTF8.GetString(myDataBuffer);

            var products = JsonConvert.DeserializeObject <List <Product> >(downloadedString);

            return(View(products));
        }
Esempio n. 2
0
 public IActionResult Index()
 {
     _logger.LogInformation("\nEn person " + GetIpAddress.GetIPAddress() + " har besøgt forsiden!\n");
     return(View());
 }
Esempio n. 3
0
 // GET: Products
 public async Task <IActionResult> Index()
 {
     _logger.LogInformation("\nEn person " + GetIpAddress.GetIPAddress() + " har besøgt produkt siden!\n");
     return(View(await _context.Product.ToListAsync()));
 }