Condition to pass the parameter inside the list
<p>I don't know how to do the if check condition inside my list,i believe "Lambda Expressions" my help but don't know </p>

<p>here is my code</p>

<pre><code>   List&lt;ResourceBookingEntity&gt; ResourceBookingList = new List&lt;ResourceBookingEntity&gt;();
        foreach (var r in query)
        {
            ResourceBookingEntity RecourceEntity = new ResourceBookingEntity()
            {

                PRJ_ID = r.PRJ_ID,
                WONUM=r.WONUM,
                JOBDESC=r.JOBDESC,
                SAPCCr = // If r.PRJ_ID =1 or 2 then SAPCCr =r.WONUM 
                         // elseif r.PRJ_ID= 3then SAPCCr =r.JOBDESC
           };
            ResourceBookingList.Add(RecourceEntity);
</code></pre>

<p>Here what am trying to do,i have linq query that returns a result based on r.PRJ.ID value am trying to fill SAPCCr value.</p>

<pre><code>   If r.PRJ_ID =1 or 2 then 
   SAPCCr =r.WONUM 
   elseif r.PRJ_ID= 3
   then 
   SAPCCr =r.JOBDESC
</code></pre>

<p>Thanks in Advance</p>
