简体   繁体   中英

problems with identityuser role asp.net core

在此处输入图像描述

在此处输入图像描述

What do I do to correct this?
I am trying to implement roles. My db context was formed in a scaffolding of the database, so I don't know which class I should derivate.

在此处输入图像描述

The error is the type you are passing at.AddRoles(), it should be IdentityRole not IdentityUser.

Use the code below;

.AddRoles<IdentityRole>()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM