title: I Got error message of using a bool method in C#
body: <p>I wanna get a bool to show if person are in company or not and have the code bellow but I get this error : Method System.String GetPresent_Status(Int32) has no supported translation to SQL.</p>
  <pre><code> internal bool GetPresent_Status(int employeeID)
      {
          using (LinqDataContext context = DataContext)
          {
              var dateString = Common.Date.GregorianToPersian(DateTime.Now.Date, Common.Date.DateStringType.Short);
              var result = context.vwDailyWorks
                  .Where(ss =&gt; ss.EmployeeID == employeeID &amp;&amp; ss.Date ==dateString)
                  .Select(t =&gt; t.Even_Odd).FirstOrDefault();
              if (Convert.ToInt16(result) == 0)
              {
                  return false;
              }
              else
              {
                  return true;
              }
  
          }
      }
  </code></pre>
  <p>and I use this code here:
  Note that if if use True Or False directly near the Status , it work!!</p>
  <pre><code>public IEnumerable&lt;EmployeeInfo&gt; GetAllVisibleEmployeesInfo(string sortBy, string name, int startRowIndex, int maximumRows, string Department, bool onlyPresence = false)
      {
          name = Common.Converter.ConvertToFarsiYK(name ?? &quot;&quot;).Trim();
          var GetNowString = Common.Date.GregorianToPersian(DateTime.Now.Date, Common.Date.DateStringType.Short);
          
          using (LinqDataContext context = DataContext)
          {
              if (Department == null)
              {
                  Department = &quot;&quot;;
              }
  
              List&lt;EmployeeInfo&gt; result = context.vwDailyWorks
                  .Where(q =&gt; (q.Visible == true))
                  .Where(q =&gt; (q.DepartmentName.Contains(Department)))
                  .Where(q =&gt; (string.IsNullOrEmpty(name) ||
                                  (q.FirstName.Contains(name) ||
                                  q.LastName.Contains(name) ||
                                  q.Position.Contains(name) ||
                                  q.Floor.Contains(name) ||
                                  (q.Ext_Tel ?? -1).ToString().Contains(name) ||
                                  q.Email.Contains(name) ||
                                  q.DepartmentName.Contains(name)))
                          )
  
                  .GroupBy(t =&gt; t.EmployeeID)
                  .Select(t =&gt; new EmployeeInfo
                  {
                      FirstName = t.Max(s =&gt; s.FirstName),
                      LastName = t.Max(s =&gt; s.LastName),
                      Position = t.Max(s =&gt; s.Position),
                      DepartmentName = t.Max(s =&gt; s.DepartmentName),
                      Unit = t.Max(s =&gt; s.Unit),
                      Floor = t.Max(s =&gt; s.Floor),
                      Status =GetPresent_Status(t.Key),
                      Extension = t.Max(s =&gt; s.Ext_Tel),
                      Info = GetPresenceInfo(t.Key, false),
                      ID = t.Key,
                      Email = t.Max(s =&gt; s.Email),
                      StatusInfo = GetStatusInfo(t.Key, false)
                  }
                          )
                  .Where(w =&gt;  w.Status == true)
                  .OrderBy(sortBy)
                  .Skip(startRowIndex)
                  .Take(maximumRows)
                  .ToList();
              return result;
          }
      }
  </code></pre>