ASP.NET Core MVC 2.x comprehensive tutorial _ASP.NET Core MVC 17. Based on the authorization of Claim and Policy






First, yesterday did not speak up about things

Only administrators can access the UserController

RoleController are coupled with this role

Cham




The user is not an administrator role access


cliam Value is a key name value pairs. cliam typed



pipe edit comments page can not access the album. Because the user does not include this Cliam

A user can do to maintain Cliam page

In the user edit page displays the user's Cliam







Maintenance cliam page

Cliam need to add properties in VIewModel which

need to be returned to the user's data, so it needs a ViewModel.
Requires a user id needs a cliam list to select the user



to write a static class, define static properties



to add CliamId property

to establish View


two tables actually have a relationship

there should be a navigation property, originally existed just did not write, do not go here to write the migration




type here and StartUp which correspond to

the requirements to have this cliam could, they would not be value write a

running found still needs to be done to migrate

here to operate directly in accordance with the document. The possible use of navigation attributes are added on




the official documentation can

migrate not recorded, but the error. Rewriting missed these words






are in the constructor to initialize it



 

Guess you like

Origin www.cnblogs.com/wangjunwei/p/10930093.html