title: "Sequence contains no matching element" on ToList()
body: <p>I have a piece of code that should retrieve a <code>List</code> of <code>User</code> objects.</p>
  <pre><code>public List&lt;User&gt; GetUsersBySessions(string[] sessionStrs, string ip)
  {
      if (sessionStrs == null || string.IsNullOrEmpty(ip))
          return new List&lt;User&gt;();
      using (var ctx = new DataContext())
      {
          var ret = ctx.Sessions.Include(&quot;User&quot;).Where(s =&gt; sessionStrs.Contains(s.ID) &amp;&amp; s.IP.Equals(ip)).Select(s =&gt; s.User).ToList();
          return ret;
      }
  }
  </code></pre>
  <p>The arguments <code>sessionStrs</code> and <code>ip</code> are properly passed into the method.  However, I'm getting the following error:</p>
  <p><a href="https://imgbomb.com/i/?lqaaT" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FU1Ze.png" alt="error" /></a><br />
  <sub>(source: <a href="https://i.imgbomb.com/lqaaT.png" rel="nofollow noreferrer">imgbomb.com</a>)</sub></p>
  <p>How could this type of error be caused when I'm not using any <code>.First()</code> or <code>.Single()</code>?  I'm just trying to get all items in a table that fit into an array return them as a <code>List</code>.  I've never seen such a problem before.</p>
  <p>The following line of code even causes an error:</p>
  <pre><code>var ret = ctx.Sessions.ToList();
  </code></pre>
  <p>Here is my <code>DataContext</code>:</p>
  <pre><code>public class DataContext : DbContext
  {
      public GenericDataContext()
          : base(CONNECTION_STRING) //My CONNECTION_STRING is defined somewhere else, but I'm going to hide that for security's sake.
      {
      }
  
      public DbSet&lt;Password&gt; Passwords { get; set; }
      public DbSet&lt;Session&gt; Sessions { get; set; }
      public DbSet&lt;User&gt; Users { get; set; }
  
  }
  </code></pre>
  <p>And here is my <code>Session</code> model:</p>
  <pre><code>[Table(&quot;tbl_Sessions&quot;)]
  public class Session
  {
  
      [Column(&quot;SessionID&quot;)]
      [MaxLength(24)]
      [Required]
      [Key]
      public string ID { get; set; }
  
      [Column(&quot;UserID&quot;)]
      [Required]
      public int UserID { get; set; }
  
      [Column(&quot;IP&quot;)]
      [MaxLength(24)]
      [Required]
      public string IP { get; set; }
  
      [ForeignKey(&quot;UserID&quot;)]
      public virtual User User { get; set; }
  
  }
  </code></pre>
  <p><strong>NOTE</strong>
  Both <code>Classes</code> are properly namespaced and have their proper <code>using</code> statements, as well.</p>