title: Linq-to-SQL expression to get the max numeric value from a text column
body: <p>I have an nvarchar SQL column which contains mostly numeric values. I'm trying to come up with an L2S expression that gets me the maximum numeric value while ignoring any non-numeric values.</p>
  
  <p>The SQL that does the job is:</p>
  
  <pre><code>select top 1 value from identifier where and patindex('%[^0-9]%', value) = 0 order by CAST(value AS INT) desc
  </code></pre>
  
  <p>What LINQ expression can I use to achieve the same thing?</p>