title: LINQ: Invalid anonymous type member declarator. Anonymous type members must be declared with a member assignment, simple name or member access
body: <p>I have the following SQL snippet within a select statement:</p>
  
  <pre><code>CASE 
  WHEN wot.id LIKE '%Correct%' THEN 'Corrective'
  WHEN wot.id LIKE '%Pred%' THEN 'Preventative'
  ELSE 'OTHER'
  END
  AS worktype
  </code></pre>
  
  <p>which I have translated into LINQ to SQL like this:</p>
  
  <pre><code>WorkType = groupItem.Key.Id.Contains("Correct") ? "Corrective" : "OTHER" || 
  WorkType = groupItem.Key.Id.Contains("Pred") ? "Preventative" : "OTHER"
  </code></pre>
  
  <p>If I add one or the other by itself into the select statement, then the query works fine.  However, when I add the OR statement and try to use both statements in the select, I get an "Invalid anonymous type member declarator. Anonymous type members must be declared with a member assignment, simple name or member access" error.</p>
  
  <p>I've seen the other questions about this error and in those cases they rename one of the statements (ex. WorkType, Work_Type) in order to fix the problem.  However, Worktype is the name of my output field so I need to have both be WorkType.</p>
  
  <p>Any ideas? </p>