第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

從身份擴(kuò)展屬性的問題(ASP.NET Core)

從身份擴(kuò)展屬性的問題(ASP.NET Core)

C#
元芳怎么了 2021-05-12 17:17:12
我無法從Identity擴(kuò)展屬性。這樣做的全部原因是使我的員工數(shù)據(jù)庫與應(yīng)用程序數(shù)據(jù)庫(包括身份信息)集成在一起,并將其用作一個大型數(shù)據(jù)庫。我嘗試遵循此答案,但似乎他們正在使用另一版本的ASP.NET。我正在使用ASP.NET Core,版本:2.0.3這是我ApplicationUser.cs文件的代碼using System;using System.Collections.Generic;using System.Linq;using System.Security.Claims;using System.Threading.Tasks;using Microsoft.AspNetCore.Identity;namespace src.Models{    public class ApplicationUser : IdentityUser    {        public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager) {            var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);            userIdentity.AddClaim(new Claim("FirstName", this.FirstName.ToString()));            userIdentity.AddClaim(new Claim("LastName", this.LastName.ToString()));            userIdentity.AddClaim(new Claim("JobTitle", this.JobTitle.ToString()));            userIdentity.AddClaim(new Claim("Status", this.Status.ToString()));            return userIdentity;        }        string FirstName { get; set; }        string LastName { get; set; }        string JobTitle { get; set; }        string Status { get; set; }        int Age { get; set; }    }}我在出現(xiàn)錯誤CreateIdentityAsync,并顯示以下錯誤:'UserManager<ApplicationUser>' does not contain a definition for 'CreateIdentityAsync' and no extension method 'CreateIdentityAsync' accepting a first argument of type 'UserManager<ApplicationUser>' could be found (are you missing a using directive or an assembly reference?) [src]和上的錯誤DefaultAuthenticationTypes,錯誤:The name 'DefaultAuthenticationTypes' does not exist in the current context [src]使用ASP.NET Core無法做到這一點,還是我做錯了什么?
查看完整描述

2 回答

  • 2 回答
  • 0 關(guān)注
  • 141 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號