// 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)); }
public IActionResult Index() { _logger.LogInformation("\nEn person " + GetIpAddress.GetIPAddress() + " har besøgt forsiden!\n"); return(View()); }
// 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())); }