title: using a IF type statement in a linq to entities SELECT NEW clause C#
body: <p>I am returning data from 2 tables, one with stop information and another with delivery information.  There can be a stop with no delivery, or with multiple deliveries.</p>
  
  <p>I am returning to a datagrid and I am wanting a column showing if the record is a stop or a stop with delivery.</p>
  
  <p>If the record does not have a delivery (is null) my current query returns a '0' in the deliveryID field.</p>
  
  <p>I am wanting to add another field called rowType where if the deliveryID = 0 it returns a value of "Stop Only" and if anything else it returns "Stop with Delivery"
  The below code works correctly but without the new field.</p>
  
  <pre><code>  var combinedEvents = (from d in dbContext.stop_details
                                join s in dbContext.stop_event on d.id equals s.stop_id into Inners
                                from sd in Inners.DefaultIfEmpty()
                                where (d.ship_date &gt;= startDate &amp;&amp; d.ship_date &lt;= endDate)
                                select new
                                {
                                    deliveryID = (int?)sd.id ?? 0,
                                    stopID = d.id,
                                    d.ship_date,
                                    d.cust_ref_1_BOL,
                                    d.cust_ref_2_OrderNum,
                                    sd.received_by
                                    }).ToList();
  </code></pre>
  
  <p>Can I do this someway?</p>