title: Why can LINQ not translate string.IsNullOrWhiteSpace()?
body: <p>Can someone explain why this compiles but creates an exception at runtime because it is not able to translate to sql/entities correctly?  Trying to gain understanding of what is happening behind the scenes.</p>
  
  <pre><code> var data = (from e in db.Employees
              join egp in db.EmployeeGrievanceMappings on e.EmployeeID equals egp.EmployeeID
              join et in db.EmployeeTypes on egp.EmployeeTypeID equals et.EmployeeTypeID
                      where et.EmployeeTypeName == employeeeType
              select new GrievantStewardBO()
              {
                  Id = e.EmployeeADID,
                  EmployeeID = e.EmployeeID,
                  EmployeeTypeID = egp.EmployeeTypeID,
                  GrievanceID = egp.GrievanceID,
                  EmployeeGrievanceID = egp.EmployeeGrievanceID,
                  text =  string.IsNullOrWhiteSpace( e.EmployeeLastName) ? e.EmployeeFirstName : e.EmployeeLastName + "," + e.EmployeeFirstName,
                  FirstName = e.EmployeeFirstName,
                  LastName = e.EmployeeLastName
  
              }).
          ToList();
  </code></pre>
  
  <p>I know I can write this and have it work correctly, I just wanted to gain some understanding for similar run-ins with LINQ.</p>
  
  <pre><code>text =   e.EmployeeLastName == null || e.EmployeeLastName.Trim() == "" ? e.EmployeeFirstName : e.EmployeeLastName + "," + e.EmployeeFirstName
  </code></pre>
  
  <p>Related question:  Why does Trim() translate correctly in LINQ?</p>