ASP.NET project help
I am currently on the ASP.NET project and am having an issue with step 2:

We’ll need to access each grocery item in the page model for the home page.

In Pages/Index.cshtml.cs , define a Foods field that stores the result of Inventory.ToList() .

( Inventory is a static class, and can be accessed by the IndexModel directly.)
The issue I am running into it doesn’t really give enough information on what data type I am supposed to make the food field, in the hint it has the following:

Remember that Inventory.ToList() has a return type of List<GroceryItem> .
If I try public List Foods {get;set;}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;

using GroceryStore.Models;

namespace GroceryStore.Pages
  public class IndexModel : PageModel

    public int Rating { get; set; }
    public string Feedback { get; set; }
    public List<GroceryItem> Foods {get;set;}
    public void OnGet()



I get the following error which can be seen at the img link

any help would be appreciated.

I am having the same problem!

Same here :wink: It seems I had one week pause, and I cannot recall what is happening here. Good the video tutorial exists

The tutorial videos for ASP.NET didn’t exist yet when I was going through it, the course had just been released. I was able to figure it out eventually if I remember correctly. I may just go restart the entire thing and work through it again at this point.