最佳答案
I am trying to create a user using claim identity asp.net 创建声明身份用户时出现此错误。
ApplicationUser user = new ApplicationUser {
EmailConfirmed = true,
UserName = model.myUser.Email,
Email = model.myUser.Email ,
PhoneNumber = model.myUser.PhoneNumber,
PhoneNumberConfirmed = true,
UserImagePath = model.myUser.UserImagePath,
FirstName= model.myUser.FirstName,
LastName = model.myUser.LastName,
DateOfBirth = model.myUser.DateOfBirth,
Culture = model.myUser.Culture,
Role = model.myUser.Role
};
but when the code was
var user= new ApplicationUser {
UserName = model.myUser.Email,
Email = model.myUser.Email ,
};
it worked perfectly, so i want to know what is wrong