To create a data context and possibly create a new user class for Identity, select the + button.You must select at least one file to add your data context. For the data context ( DbContext class):.Views/Shared/_Layout.cshtml for MVC projects or Blazor Server projects with existing MVC infrastructure.Pages/Shared/_Layout.cshtml for Razor Pages or Blazor Server projects with existing Razor Pages infrastructure.If you have an existing, customized layout page for Identity ( _Layout.cshtml), select your existing layout page to avoid overwriting your layout with incorrect markup by the scaffolder.In the Add Identity dialog, select the options you want.From the left pane of the Add New Scaffolded Item dialog, select Identity.From Solution Explorer, right-click on the project > Add > New Scaffolded Item.Scaffold Identity into a Razor project without existing authorization Typically, apps that were created with individual accounts should not create a new data context. For example, see Require Email Confirmation. Services to enable these features must be added manually. Services or service stubs aren't generated when scaffolding Identity. Services are required when using Two Factor Authentication, Account confirmation and password recovery, and other security features with Identity. Inspect the changes after running the Identity scaffolder. We recommend using a source control system that shows file differences and allows you to back out of changes. This document explains the steps needed to complete an Identity scaffolding update. You have the option of selecting Identity code to be generated.Īlthough the scaffolder generates most of the necessary code, you need to update your project to complete the process. To gain full control of the UI and not use the default RCL, see the section Create full Identity UI source.Īpplications that do not include authentication can apply the scaffolder to add the RCL Identity package. Generated code takes precedence over the same code in the Identity RCL. For example, you could instruct the scaffolder to generate the code used in registration. You might want to generate source code so you can modify the code and change the behavior. Applications that include Identity can apply the scaffolder to selectively add the source code contained in the Identity Razor Class Library (RCL). ASP.NET Core provides ASP.NET Core Identity as a Razor Class Library.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |