title: String.Split in a Linq-To-SQL Query?
body: <p>I have a database table that contains an nvarchar column like this:</p>
  
  <pre><code>1|12.6|18|19
  </code></pre>
  
  <p>I have a Business Object that has a Decimal[] property.</p>
  
  <p>My LINQ Query looks like this:</p>
  
  <pre><code>var temp = from r in db.SomeTable select new BusinessObject {
      // Other BusinessObject Properties snipped as they are straight 1:1
      MeterValues = r.MeterValues.Split('|').Select(Decimal.Parse).ToArray()
  };
  var result = temp.ToArray();
  </code></pre>
  
  <p>This throws an NotSupportedException: <code>Method 'System.String[] Split(Char[])' has no supported translation to SQL.</code></p>
  
  <p>That kinda sucks :) Is there any way I can do this without having to add a string property to the business object or selecting an anonymous type and then iterating through it?</p>
  
  <p>My current "solution" is:</p>
  
  <pre><code>var temp = from r in db.SomeTable select new {
      mv = r.MeterValues,
      bo = new BusinessObject { // all the other fields }
  };
  var result = new List&lt;BusinessObject&gt;();
  foreach(var t in temp) {
      var bo = t.bo;
      bo.MeterValues = t.mv.Split('|').Select(Decimal.Parse).ToArray();
      result.Add(bo);
  }
  return result.ToArray(); // The Method returns BusinessObject[]
  </code></pre>
  
  <p>That's kinda ugly though, with that temporary list.</p>
  
  <p>I've tried adding a <code>let mv = r.MeterValues.Split('|').Select(Decimal.Parse).ToArray()</code> but that essentially leads to the same NotSupportedException.</p>
  
  <p>This is .net 3.5SP1 if that matters.</p>