1
我想檢查在ASP.NET身份中是否存在具有特定用戶名和密碼的用戶。我想,這是我的代碼:實體類型IdentityUser不是ASP.NET身份中當前上下文的模型的一部分
UserManager<IdentityUser> userManager = new UserManager<IdentityUser>(new UserStore<IdentityUser>(new ApplicationDbContext()));
var user = await userManager.FindAsync(userName, password);
然而,不順心的事,那就是錯誤:
The entity type IdentityUser is not part of the model for the current context.
你能告訴我一個解決方案嗎?
我的工作,但現在我還有一個問題。 FindAsync函數不響應 –
我更新答案 –