title: "LINQ to Entities does not recognize the method 'Boolean ***, and this method cannot be translated into a store expression."
body: <p>I am coding a MVC 5 internet application, and am getting the following error:</p>
  
  <pre><code>base = {"LINQ to Entities does not recognize the method 'Boolean IsAccountSetupForSendingFreeTrialSubscriptionExpirationEmail(CanFindLocation.Models.Account)' method, and this method cannot be translated into a store expression."}
  </code></pre>
  
  <p>Here are my methods:</p>
  
  <pre><code>public IEnumerable&lt;Account&gt; GetFreeTrialAccountsForSendDailyExpirationEmails(int minimumDaysLeftInSubscriptionForEmail)
  {
      IEnumerable&lt;Account&gt; freeTrialAccounts = genericMultipleRepository.accounts.Value.SearchFor(a =&gt; IsAccountSetupForSendingFreeTrialSubscriptionExpirationEmail(a) &amp;&amp; ShouldDailyExpirationEmailBeSentForFreeTrialAccount(a, minimumDaysLeftInSubscriptionForEmail));
      return freeTrialAccounts;
  }
  
  public bool IsAccountSetupForSendingFreeTrialSubscriptionExpirationEmail(Account account)
  {
      if (account.isFreeTrial &amp;&amp; account.sendSubscriptionExpirationEmail)
      {
          return true;
      }
      else
      {
          return false;
      }
  }
  
  public bool ShouldDailyExpirationEmailBeSentForFreeTrialAccount(Account account, int minimumDaysLeftInSubscriptionForEmail)
  {
      if (IsExpiresDateTimeLessThanMinimumDaysLeftInFreeTrialSubscription(account, minimumDaysLeftInSubscriptionForEmail) &amp;&amp; !HasSubscriptionEmailBeenSentForCurrentFreeTrialEndDateTime(account))
      {
          return true;
      }
      else
      {
          return false;
      }
  }
  
  public bool IsExpiresDateTimeLessThanMinimumDaysLeftInFreeTrialSubscription(Account account, int minimumDaysLeftInSubscriptionForEmail)
  {
      TimeSpan expires = account.freeTrialEndDate - DateTime.UtcNow;
      return expires.Days &lt; minimumDaysLeftInSubscriptionForEmail;
  }
  
  public bool HasSubscriptionEmailBeenSentForCurrentFreeTrialEndDateTime(Account account)
  {
      return account.subscriptionEndDateForExpirationEmail == account.freeTrialEndDate;
  }
  </code></pre>
  
  <p>My Account object has the following fields:</p>
  
  <pre><code>public bool isFreeTrial { get; set; }
  public bool sendSubscriptionExpirationEmail { get; set; }
  public DateTime subscriptionEndDateForExpirationEmail { get; set; }
  public DateTime freeTrialEndDate { get; set; }
  </code></pre>
  
  <p>I have done some research, and I gather that the code that I have written cannot be converted into a LINQ expression.</p>
  
  <p>What do I need to do to convert my code into a valid form so that the LINQ to Entities does not perform the error?</p>
  
  <p>Thanks in advance.</p>