title: Image data type in SQL Server Comapct 4 & Code-First Entity Framewwork 5
body: <p>My Code-First entity column is declared like this:</p>
  
  <pre><code>[Required, DataType("image")]
  public byte[] Picture { get; set; }
  </code></pre>
  
  <p>Validations are turned off:</p>
  
  <pre><code>Configuration.ValidateOnSaveEnabled = false;
  </code></pre>
  
  <p>And is column type is still <code>varbinary(4000)</code>.</p>
  
  <p>When I try to save data, Entity Framework throws an exception:</p>
  
  <p><em>Byte array truncation to a length of 4000.</em></p>
  
  <p>How to declare that C# <code>byte[]</code> type should be mapped to <code>image</code> SQL type?</p>
  
  <p><strong>Versions:</strong></p>
  
  <p>SQL Server Compact 4</p>
  
  <p>Entity Framework 5 RC</p>
  
  <p>.NET Framework 4.0</p>