Wednesday, 15 May 2013

c# - The length of UserName of Table UserProfile -



c# - The length of UserName of Table UserProfile -

the next shows code of automatically generated class userprofile when creating new asp.net mvc 4 web application. column of table userprofile have type of nvarchar(56) not null. however, doesn't have attribute of maxlength(56) , required? why has length of 56 , nullibility of not null?

i need add together email property class , using migration update table. should add together attribute [required, maxlength(256)] string email?

[table("userprofile")] public class userprofile { [key] [databasegeneratedattribute(databasegeneratedoption.identity)] public int userid { get; set; } public string username { get; set; } }

the reply yes, go ahead , add together needed attributes. farther read info annotations here

plus username field hardly more 56 characters. example, adil.mughal user name , not sure how 56 number identified in membership api it's plenty need.

c# asp.net entity-framework asp.net-mvc-4 entity-framework-5

No comments:

Post a Comment