locked
Scaffold razor pages using Entity Framework (CRUD) not working RRS feed

  • Question

  • 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 screenshot 

    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?





    • Edited by Mickey Mouze Sunday, June 21, 2020 9:24 AM
    • Moved by CoolDadTx Monday, June 22, 2020 2:05 PM ASP.NET related
    Sunday, June 21, 2020 9:13 AM

All replies

  • Hello,

    The truly best place to post this is here as it sound like an "issue" and the page below is were issues are posted and watched.

    https://github.com/aspnet/Tooling/issues/


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Sunday, June 21, 2020 9:49 PM
  • Please post questions related to ASP.NET in the ASP.NET forums. This forum is for C#-specific questions only. 

    Questions related specifically to EF can be posted in the EF forums on this site.


    Michael Taylor http://www.michaeltaylorp3.net


    • Edited by CoolDadTx Monday, June 22, 2020 2:04 PM Forgot link
    Monday, June 22, 2020 2:04 PM