title: LINQ to Entities does not recognize ToString using query syntax
body: <p>I'm getting this error in a LINQ query (query syntax used). In the past I've gotten this error when using dot syntax in my LINQ query so all I had to do is a call to ToList() and then select using an anonymous class. But in my case where I'm now using query syntax, how do I do the same thing? Yes I'm using EF.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>            var dataList = from h in context.Horaires
              join e in context.Employes on h.iIdEmploye equals e.iIdEmploye
              join p in context.Postes on h.iIdPoste equals p.iIdPoste
              join g in context.GroupesPostes on p.iIdGroupePoste equals g.iIdGroupePoste
              join en in context.EnsemblesPostes on g.iIdEnsemblePoste equals en.iIdEnsemblePoste
              join d in context.Departements on e.iIdDepartement equals d.iIdDepartement
              where p.bitActif == true &amp;&amp; h.dteDate == p.dteDate
              orderby e.sIdEmployeClient
              select new ScenarioScheduleItemModel
              {
                  H = "D",
                  EmployeeSchedule = "EmployeeSchedule",
                  EmployeeSchedule2 = "EmployeeSchedule",
                  EmployeeXrefCode = e.sIdEmployeClient,
                  // ToString used here for StartTime and EndTime
                  StartTime = h.dteDate.ToString(CultureInfo.InvariantCulture).Substring(0, 10) + "T" + p.dteHeureDebut.ToString(CultureInfo.InvariantCulture).Substring(11, 8),
                  EndTime = h.dteDate.ToString(CultureInfo.InvariantCulture).Substring(0, 10) + "T" + p.dteHeureFin.ToString(CultureInfo.InvariantCulture).Substring(11, 8),
                  DeptXrefCode = d.sNom,
                  JobXrefCode = p.sNom,
                  OrgUnit = string.Empty,
                  XrefCode = string.Empty,
                  OrgLocationTypeXrefCode = string.Empty,
                  PayAdjCodeXrefCode = string.Empty
              };
  
          var result = dataList.Distinct().ToList();
  </code></pre>