title: Lambda expressions in C# with If\Else
body: <p>I built an SQL Query that order table by complex Condition.
  here is a example with the same principle:  (Table Toto include 3 cols: id ,num1,num2)</p>
  
  <pre><code>select  t.id 
  from Toto as t
  group by t.id
  order by sum(case when t.id&lt;100 Then t.num1 ELSE t.num2 END)
  </code></pre>
  
  <p>and my question is, there is option to write this query in Lambda?(using when\else)</p>
  
  <p>thank you!</p>