title: The DataAnnotations [Phone] Attribute
body: <p>What is the default, valid format of the [Phone] attribute? 
  In the data table, the phone column is navrchar (16)
  If I enter a phone # like 1112223333, I get "field is not a valid phone number." 
  If I enter 01112223333, I get "The value '11112223333' is invalid."</p>
  
  <p>Also, how to override it?
  I understand that I could do something like this, but is this the best practice in this case?</p>
  
  <pre><code>[RegularExpression(@"((\(\d{3}\) ?)|(\d{3}-))?\d{3}-\d{4}",ErrorMessage="Invalid Phone Number!")]
  </code></pre>
  
  <p>Related code:</p>
  
  <pre><code>    [Required]
      [Phone]
      public string Phone { get; set; }
  
      &lt;div class="editor-field"&gt;
         @Html.EditorFor(model =&gt; model.Phone)
         @Html.ValidationMessageFor(model =&gt; model.Phone)
      &lt;/div&gt;
  </code></pre>
  
  <p><strong>Update</strong>
  I guess there was a mapping issue when I changed the phone column from int to navrchar. Updating the model was not enough, so I had to change the value manually using the Table Mapping.</p>
  
  <blockquote>
    <p>Error 2019: Member Mapping specified is not valid. 
    The type 'Edm.Int32[Nullable=False,DefaultValue=]' of member 'Phone' 
    in type 'UserDBModel.UserProfile' is not compatible with 
    'SqlServerCe.nvarchar[Nullable=False,DefaultValue=,MaxLength=16,Unicode=True,FixedLength=False]' 
    of member 'Phone' in type 'UserDBModel.Store.UserProfile'.</p>
  </blockquote>