I have a series of classes I have overridden 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 it says The UserName field is required.
I have tried overriding the UserName field in my ApplicationUser
class which inherits from IdentityUser
with [Index(IsUnique = false)]
however this just results in a unique constraint and a non-unique index being created.
How can I override the IdentityUser
class to make the username nullable and non-unique as I don't want to use it.
Note: I'm fully aware that you can store the email in the username field using the AllowOnlyAlphanumericUserNames
property in the UserValidator
class. I really don't like this approach and would just like to remove this constraint so I can store the record without a username. I will modify any functions that I need that use the username to look at the email address.
Here is the full implementation of the IUserStore
- http://git.io/XZ3psA I wouldn't say that there is a lot of work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With