问题描述
enter code here
I am using custom Asp .Net identity,i am getting error while calling var user = await UserManager.FindAsync( model.UserName,model.Password); .
" The specified cast from a materialized 'system.int64' type to the 'system.int32' type is not valid."
public class imsUser : IdentityUser<long,imsUserLogin,imsUserRole,imsUserClaim>
{
public async Task<ClaimsIdentity> GenerateUserIdentityAsync(imsUserManager manager)
{
var userIdentity = await manager.CreateIdentityAsync(
this,DefaultAuthenticationTypes.ApplicationCookie);
return userIdentity;
}
}
public class imsUserLogin:IdentityUserLogin<long>{}
public class imsUserRole:IdentityUserRole<long>{}
public class imsUserClaim:IdentityUserClaim<long>{}
public class imsRole:IdentityRole<long,imsUserRole>
{
public imsRole() : base() { }
public imsRole(string name,int branchId,bool isActive)
{
this.BranchId = branchId;
this.IsActive = isActive;
}
public virtual int BranchId { get; set; }
public virtual bool IsActive { get; set; }
}
Please help.
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)