I'm having difficulty identifying where in a ASP.NET Core app we specify that a model can have the FirstOrDefaultAsync method enabled. I've previously scaffolded two models to razor pages, and for those I can write async method like so:
component = await Context.component.FirstOrDefaultAsync(m => m.ID == id);
However, for this new model that I scaffolded, I used a view Model but when I swapped the models, I get an error when I use the FirstOrDefaultAsync method.
'DbSet' does not contain a definition for 'FirstOrDefaultAsync' and no accessible extension method 'FirstOrDefaultAsync' accepting a first argument of type 'DbSet' could be found (are you missing a using directive or an assembly reference?)
I've made sure that the necessary namespaces have been included in the file, and the DBContext file includes the model
public DbSet<update> update { get; set; }
I made sure to run dotnet restore and restart VSCode and am unable to find answers searching online or in the documentation