title: Loading Parent Child data using Entity Framework stored procedure
body: <p>I have two stored procedures, one to load parent data and other to load child data. Is there anyway to do this in a better way? Please see code below.</p>
  
  <pre><code>    public partial class Product
      {
          public long Id { get; set; }
          public string ProductId { get; set; }
          public string Name { get; set; }
          public string ProductionNo { get; set; }
          public string UniqueIdentificationNo { get; set; }
          public virtual ICollection&lt;Process&gt; Processes { get; set; }
      }
  
      public List&lt;GetProductsBetween_Result&gt; GetProductsBetween(DateTime? startDate, DateTime? endDate)
      {
          var products = DbContext.GetProductsBetween(startDate, endDate).ToList();
  
          foreach(var product in products)
          {
              product.Processes = DbContext.GetWaitingTime(product.Id).ToList();
          }
  
          return products;
      }
  </code></pre>