ASP.Net UserName to Email

后端 未结 7 716
北海茫月
北海茫月 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<User>
    {
        public IUserStore<User> Users { get; private set; }
        public UserManager(IUserStore<User> store) : base(store)
        {
            Users = store;
            UserValidator = new UserValidator<User>(this) {AllowOnlyAlphanumericUserNames = false};
        }
    }
    
    0 讨论(0)
提交回复
热议问题