Visual Studio 2015 脚手架使用UserManager<TUser>
不能用于创建ClaimsIdentity
. 有没有人有一个关于如何做到这一点的工作示例?
VS2015 脚手架抛出错误:
public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager)
{
// Note the authenticationType must match the one
// defined in CookieAuthenticationOptions.AuthenticationType
var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
// Add custom user claims here
return userIdentity;
}
注意:我添加了ApplicationUser
不与IdentyUser
.