I am trying to create a user using claim identity asp.net I get this error while creating claims identity user.
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