Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tutorial samples #15924

Merged
merged 17 commits into from
Nov 30, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Modify add-user-data.md to reference sample-3.0 folder
eslam-fakhry committed Nov 29, 2019
commit ed0303a9d0db85697c6f5de109f8d47a32ca4fa0
16 changes: 8 additions & 8 deletions aspnetcore/security/authentication/add-user-data.md
Original file line number Diff line number Diff line change
@@ -22,15 +22,15 @@ The project sample is created from a Razor Pages web app, but the instructions a

## Prerequisites

[!INCLUDE [](~/includes/2.2-SDK.md)]
[!INCLUDE [](~/includes/3.0-SDK.md)]

## Create a Razor web app

# [Visual Studio](#tab/visual-studio)

* From the Visual Studio **File** menu, select **New** > **Project**. Name the project **WebApp1** if you want to it match the namespace of the [download sample](https://github.com/aspnet/AspNetCore.Docs/tree/live/aspnetcore/security/authentication/add-user-data) code.
* Select **ASP.NET Core Web Application** > **OK**
* Select **ASP.NET Core 2.2** in the dropdown
* Select **ASP.NET Core 3.0** in the dropdown
guardrex marked this conversation as resolved.
Show resolved Hide resolved
* Select **Web Application** > **OK**
eslam-fakhry marked this conversation as resolved.
Show resolved Hide resolved
* Build and run the project.

@@ -102,9 +102,9 @@ Follow the instruction in [Migrations, UseAuthentication, and layout](xref:secur

Update the `IdentityUser` derived class with custom properties. If you named the project WebApp1, the file is named *Areas/Identity/Data/WebApp1User.cs*. Update the file with the following code:

[!code-csharp[Main](add-user-data/sample-2.2/Areas/Identity/Data/WebApp1User.cs)]
[!code-csharp[Main](add-user-data/sample-3.0/Areas/Identity/Data/WebApp1User.cs)]
guardrex marked this conversation as resolved.
Show resolved Hide resolved

Properties decorated with the [PersonalData](/dotnet/api/microsoft.aspnetcore.identity.personaldataattribute?view=aspnetcore-2.1) attribute are:
Properties decorated with the [PersonalData](/dotnet/api/microsoft.aspnetcore.identity.personaldataattribute?view=aspnetcore-3.0) attribute are:
guardrex marked this conversation as resolved.
Show resolved Hide resolved

* Deleted when the *Areas/Identity/Pages/Account/Manage/DeletePersonalData.cshtml* Razor Page calls `UserManager.Delete`.
* Included in the downloaded data by the *Areas/Identity/Pages/Account/Manage/DownloadPersonalData.cshtml* Razor Page.
@@ -113,21 +113,21 @@ Properties decorated with the [PersonalData](/dotnet/api/microsoft.aspnetcore.id

Update the `InputModel` in *Areas/Identity/Pages/Account/Manage/Index.cshtml.cs* with the following highlighted code:

[!code-csharp[Main](add-user-data/sample-2.2/Areas/Identity/Pages/Account/Manage/Index.cshtml.cs?name=snippet&highlight=28-36,63-64,98-106,119)]
[!code-csharp[Main](add-user-data/sample-3.0/Areas/Identity/Pages/Account/Manage/Index.cshtml.cs?name=snippet&highlight=24-32,48-49,91-99,101)]
eslam-fakhry marked this conversation as resolved.
Show resolved Hide resolved

Update the *Areas/Identity/Pages/Account/Manage/Index.cshtml* with the following highlighted markup:

[!code-html[Main](add-user-data/sample-2.2/Areas/Identity/Pages/Account/Manage/Index.cshtml?highlight=35-42)]
[!code-html[Main](add-user-data/sample-3.0/Areas/Identity/Pages/Account/Manage/Index.cshtml?highlight=16-24)]
eslam-fakhry marked this conversation as resolved.
Show resolved Hide resolved

### Update the Account/Register.cshtml page

Update the `InputModel` in *Areas/Identity/Pages/Account/Register.cshtml.cs* with the following highlighted code:

[!code-csharp[Main](add-user-data/sample-2.2/Areas/Identity/Pages/Account/Register.cshtml.cs?name=snippet&highlight=28-36,67,66)]
[!code-csharp[Main](add-user-data/sample-3.0/Areas/Identity/Pages/Account/Register.cshtml.cs?name=snippet&highlight=30-38,70-71)]
eslam-fakhry marked this conversation as resolved.
Show resolved Hide resolved

Update the *Areas/Identity/Pages/Account/Register.cshtml* with the following highlighted markup:

[!code-html[Main](add-user-data/sample-2.2/Areas/Identity/Pages/Account/Register.cshtml?highlight=16-25)]
[!code-html[Main](add-user-data/sample-3.0/Areas/Identity/Pages/Account/Register.cshtml?highlight=16-25)]
eslam-fakhry marked this conversation as resolved.
Show resolved Hide resolved

Build the project.