Identity Scaffolding Context class

Dean Everhart 1,541 Reputation points
2023-02-03T14:25:12.16+00:00

Should the existing context class be chosen at projectname.data. or a second context class be created at projectname.areas.identity.data.WebApplication1Context.

Confused about the wording in the tutorial: "create a new Data context class. Accept the default value or specify a class"

Tutorial: https://learn.microsoft.com/en-us/aspnet/core/security/authentication/scaffold-identity?view=aspnetcore-6.0&tabs=visual-studio#scaffold-identity-into-a-razor-project-with-authorization

  • Select the + button to create a new Data context class. Accept the default value or specify a class (for example, MyApplication.Data.ApplicationDbContext).
Developer technologies ASP.NET ASP.NET Core
Developer technologies ASP.NET Other
0 comments No comments
{count} votes

Accepted answer
  1. AgaveJoe 30,126 Reputation points
    2023-02-03T15:16:25.41+00:00

    You did not explain exactly what you're doing. But, the scenario (link provided) is used when you want to change the Identity templated Razor Pages.

    The "Add Identity" windows is letting you select a current DbContext from the dropdown or create a new DbContext by clicking the plus button. Given the scenario, I assume you already created the DbContext and just want to select the DbContext from the dropdown.

    Capture


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.