I am using Asp.Net Identity 2.0 in my MVC 5 project.
Why is column PhoneNumber
using [nvarchar](max)
in SQL Server database table [dbo].[AspNetUsers]
?
Can I change this to [nvarchar](64)
, for example?
I created a class ApplicationUser : IdentityUser
in which I override property PhoneNumber
with attribute [MaxLength(64)]
.
public class ApplicationUser : IdentityUser
{
[MaxLength(64)]
public override string PhoneNumber { get; set; }
public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager)
{
var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
return userIdentity;
}
}
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