如何在新的 ASP.NET 身份系统中使用电子邮件而不是用户名?
我试图改变RegisterViewModel
班级:
[Display(Name = "Email address")]
[Required(ErrorMessage = "The email address is required")]
[EmailAddress(ErrorMessage = "Invalid Email Address")]
public string UserName { get; set; }
但是当我输入邮件地址时,我收到了错误:
User name fsdfsd@fsdfsd.de is invalid, can only contain letters or digits.