title: Entity Framework 5 code first map string to varchar globally
body: <p>I am playing around with EF 5 and code first. So far I really like it, but I have noticed it defaults string columns to nvarchar. If I want to use varchar, then I have to explicitly tell it to.</p>
  
  <p>I can force it to use varchar instead of nvarchar for strings as follows:</p>
  
  <pre><code>public class Member
  {
      public int id { get; set; }
  
      [MaxLength(255), Required, Column(TypeName = "varchar")]
      public string firstName { get; set; }
  
      [MaxLength(255), Required, Column(TypeName = "varchar")]
      public string surname { get; set; }
  }
  </code></pre>
  
  <p>I would typically use varchar instead of nvarchar in almost all cases though, so I would much prefer to have string columns globally mapped to varchar, and to be able to set nvarchar on a per-column basis as above if I need to.</p>
  
  <p>Does anyone know a way to do this? I am trying to omit the need for typing [Column(TypeName = "varchar")] for every string column in my model.</p>