Asp.Net Identity save user without email

前端 未结 5 882
旧时难觅i
旧时难觅i 2021-01-31 03:24

I want to save user without email, like this:

var user = new ApplicationUser { UserName = model.Name };
var result = await UserManager.CreateAsync(user);
         


        
5条回答
  •  情歌与酒
    2021-01-31 04:24

    In startup file you can disable RequireUniqueEmail by access IdentityOptions configuration Also here you can change complexity of password , Lockout,...

      services.Configure(x =>
            {
                x.User.RequireUniqueEmail = false;
    
                //x.Password.RequireUppercase = false; => other condition for identity
    
            });
    

    you should use Microsoft.AspnetCore.Identity, address of doc here

提交回复
热议问题