title: LINQ to Entities - method cannot be translated into a store expression
body: <p>The same query worked in .Net 3.5 but not in .Net 4.5.2 
  There are lots of posts here with the same error, and tried almost all but of no use.
  I have extracted everything into a separate variable for querying. Still i am getting the error - </p>
  
  <blockquote>
    <p>LINQ to Entities does not recognize the method 'System.String Format(System.String, System.Object)' method, and this method cannot be translated into a store expression.</p>
  </blockquote>
  
  <pre><code> private void LoadAppointmentData()
          {
              var user = Session["user"].ToString();
              var userFirstName = db.Users.SingleOrDefault(u =&gt; u.FirstName == user);
  
              var userFN = userFirstName.username;
              var chwWorker = from c in db.PatientContacts
                              where c.UserName == userFN &amp;&amp;
                                   (c.PCP_Status == "Appointment Made" || c.PCP_Status_AWC == "Appointment Made"
                                     || c.PCP_Status_AWDV == "Appointment Made" ||
                                   (c.PCP_Status == "RX for Mamogram" &amp;&amp; c.Status == "Appointment Made")) 
                              orderby c.PCP_Status_Date descending 
                              select new
                              {
                                  Id = c.MemberID,
                                  Name = c.PatientFirstName + " " + c.PatientLastName, 
                                  PCP_Appt = $"{c.PCP_Status_Date:d}",
                                  Mammogram_Appt = $"{c.StatusDate:d}",
                                  Phone = GetPhone(c.MemberID)
                              };
              if (chwWorker.Any())
              {
                  if (grvAppointmentList != null)
                  {
                      pnlAppointmentFollowUp.Visible = true;
                      grvAppointmentList.DataSource = chwWorker;
                      grvAppointmentList.DataBind();
                  }
              }
  }
  </code></pre>
  
  <p>I am not sure what else to change to make this query run. </p>