title: The proper way to declare SQL Server varbinary field with LINQ
body: <p>Learning ropes with LINQ here, well experienced with classic SQL and ADO.</p>
  
  <p>Before I go on with my project and make any type changes too expensive, please let me know what the correct way is to use the varbinary columns. How should they be declared with LINQ? What type it should map to in order not to cause any pain.</p>
  
  <p>Right now I have tested mapping to byte[] array, and it works pretty well with some initial testing. I plan to store data gathered from streams, and since the contents of streams can be got in byte array format via <code>ToArray()</code> method, this approach seems to be viable.</p>
  
  <pre><code>private byte[] _testVarbinary;
  [Column(Storage="_testVarbinary")]
  public byte[] testVarbinary
  {
      get
      {
          return this._testVarbinary;
      }
      set
      {
          this._testVarbinary = value;
      }
  }
  
  ...
  
  // Reading
  Console.WriteLine("Field size: {0}", f.testVarbinary.Length);
  
  // Updating
  f.testVarbinary = new byte[]{128, 129, 130, 131};
  db.SubmitChanges();
  </code></pre>
  
  <p>So, should I map to some other, more LINQ-esque type instead? Or sticking with basic <code>byte[]</code> is just fine.</p>