Scaffold razor pages using Entity Framework (CRUD) not working

  • Thread starter Thread starter Mickey Mouze
  • Start date Start date
M

Mickey Mouze

Guest
I posted this question on stack overflow and I was urged to to post it to this forum instead.

I am trying to scaffold a users admin CRUD razor pages using Entity Framework (via Add –> New Scaffolded Item --> Razor Pages using Entity Framework (CRUD)) but Visual Studio lists neither my model classes nor the context class as shown in the following screenshot1603193.png

The razor pages are located in an `App.Web` project while the model class and the context classes (see below) are in an `App.Core` project.

// The db context class
public class IdentityContext : IdentityDbContext<ApplicationUser>
{

public IdentityContext(DbContextOptions<IdentityContext> options)
: base(options) { }
}

// The model class I would like to scaffold
public class ApplicationUser : IdentityUser
{
public string FirstName { get; set; }
public string LastName { get; set; }

}

Strangely, it lists other model classes but not the the ApplicationUser and the IdentityDbContext class I need to make the scaffolding.
For reference, I am using the latest Visual Studio (VS Community 2019, Version 16.6.2) with .NET Core 3.1.301. Does anyone know how this could be solved?

Continue reading...
 
Back
Top