title: C# Ternary Operator used in LINQ query
body: <p>Is it possible to use the <strong>ternary operator</strong> to reflect this logic?</p>
  
  <pre><code>if (a = 1)
  {
      somevalue = "hello";
  } 
  else if (a = 2)
  {
      someValue = "world";
  }
  else if (a = 3)
  {
      someValue = "hellWorld";
  }
  </code></pre>
  
  <p>I am doing the following in a LINQ Query: </p>
  
  <pre><code>using (var data = new DAL())
  {
      var result = data.Holidays.AsNoTracking()
                   .Where(x =&gt; x.RequesterId == userId)
                   .Select(x =&gt; new HolidayModel
                   {
                       HolidayId = x.HolidayId,
                       FromDate = x.FromDate,
                       ToDate = x.ToDate,
                       AuthorisationStatus = x.InternalHolidayStatus == 1 ?
                           HolidayAuthStatus.Pending :
                           HolidayAuthStatus.Rejected,
                       DateModified = x.ModifiedDate
                   }).ToList();
  
      return Json(result.ToDataSourceResult(request));
  }
  </code></pre>
  
  <p><code>HolidayAuthStatus</code> is an enum, which has three values in it (<code>Pending</code> (1), <code>Authorised</code> (2) and <code>Rejected</code> (3)); and I would like to reflect this in code when assigning the value of <code>AuthorisationStatus</code>.</p>