ASP.Net UserName to Email

后端 未结 7 759
北海茫月
北海茫月 2020-11-29 06:35

I am working with the new ASP.NET Identity (RTM) and I was wondering how would I go on about changing registering and login from being a UserName to an Email.

The id

7条回答
  •  情书的邮戳
    2020-11-29 07:14

    Change the UserValidator property for your UserManager object:

    public class UserManager : UserManager
    {
        public IUserStore Users { get; private set; }
        public UserManager(IUserStore store) : base(store)
        {
            Users = store;
            UserValidator = new UserValidator(this) {AllowOnlyAlphanumericUserNames = false};
        }
    }
    

提交回复
热议问题