title: How to get blob size without getting the value itself with Entity Framework
body: <p>How to get size of <code>blob</code> (<code>varbinary(max)</code>) from SQL Server without getting the blob itself with Entity Framework in C#? </p>
  
  <pre><code>using (var context = new EntityBazaCRM(Settings.sqlDataConnectionDetailsCRM))
          {
              Settings.WybraneSzkolenie = context.Szkolenies.FirstOrDefault(d =&gt; d.SzkolenieID == szkolenieId);
  
  }
  </code></pre>
  
  <p>In sql I would do it <code>select Len(field) from table</code>? Or the only way to do it is to actually store the value as another column? It doesn't make sense to load blob's to computer (especially on slow links) and then using <code>Blob.Length</code>. </p>