I have a number of classes that I redefined for use in ASP.NET Identity 2.0 so that they use the email address field rather than the email field.
When trying to create a user, he says The UserName field is required. I tried to override the UserName field in my ApplicationUser class, which inherits from IdentityUser using [Index(IsUnique = false)] , however this just leads to a unique constraint and a unique index to create.
How to override the IdentityUser class to make the username null and not unique since I don't want to use it.
Note. I fully know that you can save the email in the username field using the AllowOnlyAlphanumericUserNames property in the UserValidator class. I really do not like this approach and simply would like to remove this restriction in order to save the record without a username. I will change any functions that I need that use the username to view the email address.
source share