1

I need to set the email field as null in the 'AspNetUsers' table. Sometimes it uses the phone as a username. I use this table for patients some patients do not have an email. So that I need to set the null email field. I test with below code but still not working.

[Required(AllowEmptyStrings=true)]
        public override string EmailAddress { get; set; }
World News
  • 23
  • 1
  • 4
  • See https://stackoverflow.com/questions/27905245/asp-net-identity-save-user-without-email – AmirHosseinMp02 Mar 17 '22 at 08:53
  • In ASP.NET Core Identity, it saves user by using `userManager.CreateAsync(TUser user, string password)` method, you can set the username for the user by yourself. It is not limited to set email as username. Besides, the email property in IdentityUser is also nullable by default. How is your code like? Could you pls share with us? – Rena Mar 18 '22 at 05:36

0 Answers0