title: LinQ Query from different tables
body: <p>Is something like this possible?</p>
  <pre><code>var query = _context.Group
      .Where(g =&gt; g.StartDate &gt; DateTime.Now)
      .Select(g =&gt; new GroupDTO {
          Name = g.GroupName,
          StartDate = g.StartDate,
          AvailableTeachers = _context.Teacher.Where(t =&gt; t.Available)
      });
  </code></pre>
  <p>Problem is, that the availableTeachers are not linked to the group in any way in the database - I would still store them into my DTO for later use - is this possible? I keep getting an error:</p>
  <pre><code>Unable to cast object of type 'Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlFunctionExpression' to type 'System.Linq.Expressions.ConstantExpression'.
  </code></pre>
  <p><strong>UPDATE</strong></p>
  <p>This one works though and is so much better than what I tried:</p>
  <pre><code>var teachers = _context.Teacher.Where(t =&gt; t.Available).ToList();
  
  var query = _context.Group
      .Where(g =&gt; g.StartDate &gt; DateTime.Now)
      .Select(g =&gt; new GroupDTO {
          Name = g.GroupName,
          StartDate = g.StartDate,
          AvailableTeachers = teachers
      });
  </code></pre>