Home > Net >  Inheriting IdentityUser how custom properties in the field?
Inheriting IdentityUser how custom properties in the field?

Time:11-19

For example:
I use the following code inherited
Public class ApplicationUser: IdentityUser{
[Key, the Display (Name="user ID")]
Public override Int64 Id {get; set; }

[the Display (Name="username"), the Required, StringLength (20, MinimumLength=3, ErrorMessage={0} "must be a {2} - {1} characters between")]
[the Column (" UserName ")]
[RegularExpression (@ ^ "[a zA - Z0-9 - _.] * $")]
Public override string UserName {get; set; }
}
Two questions,
1: create database is still the default length, nvarchar (256) rather than 20
2: the error message is still the default text, rather than custom ErrorMessage
  • Related