title: Linq equivalent of SQL LEFT function?
body: <p>We have a database with some fields that are varchar(max) which could contain lots of text however I have a situation where I only want to select the first for example 300 characters from the field for a paginated table of results on a MVC web site for a "preview" of the field.</p>
  
  <p>for a simplified example query where I want to get all locations to display in the table
  (this would be paginated, so I don't just get everything - I get maybe 10 results at a time):</p>
  
  <pre><code>return db.locations;
  </code></pre>
  
  <p>However this gives me a location object with all the fields containing the massive amounts of text which is very time consuming to execute.</p>
  
  <p>So what I resorted to before was using SQL stored procedures with the:</p>
  
  <pre><code>LEFT(field, 300) 
  </code></pre>
  
  <p>to resolve this issue and then in the Linq to SQL .dbml file included the stored procedure to return a "location" object for the result.</p>
  
  <p>However I have many queries and I don't want to have to do this for every query.</p>
  
  <p>This maybe a simple solution, but I am not sure how I can phrase this on a search engine, I would appreciate anyone who can help me with this problem.</p>