【发布时间】:2017-03-11 10:49:42
【问题描述】:
我想在 aspnet 用户表中添加新字段..我还在帐户视图模型中添加了用户名属性..
public class ApplicationUser : IdentityUser<int, UserLogin, UserRole, UserClaim>
{
public DateTime? ActiveUntil;
public async Task<ClaimsIdentity> GenerateUserIdentityAsync(ApplicationUserManager manager)
{
var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
return userIdentity;
}
public string UserName { get; set; }
}
出现以下错误 值不能为空。 参数名称:值
{
Line 53: // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
Line 54: var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
Line 55: // Add custom user claims here
【问题讨论】:
-
@TAHA SULTAN TEMURI 您能否更详细地解释您获得赏金的原因?这个问题已经很老了,看起来已经得到了充分的回答(尽管 OP 没有接受)。
-
实际上我几周前遇到了同样的问题,所以我决定开始赏金,然后我找到了解决方案,这就是为什么现在等待关闭。
标签: asp.net asp.net-identity customization