title: EF Core one-to-many infinite includes
body: <p>I have two tables Appointment and TaskAllocation having one to many relationship. now when i get the Appointment </p>
  
  <pre><code>public IEnumerable&lt;Appointment&gt; GetAppointments(int employeeId, DateTime date)
      {
          return _context.Appointment.Where(a =&gt; a.EmployeeId == employeeId &amp;&amp; 
              a.AppointmentDate == date)
             .Include(a=&gt;a.Tasks).ToList();
      }
  </code></pre>
  
  <p>It causes including one appointment with many tasks and again one task with that appointment with many tasks and so on.</p>