title: Why is the SQL query from Entity Framework not visible in the profiler?
body: <p>Consider this piece of code:</p>
  
  <pre><code>var question = context.Questionnaires.FirstOrDefault(q =&gt; q.id == 169).Categories.ToList()[1].Questions.ToList()[0];
  </code></pre>
  
  <p>This is just some excerise code for me to get familiar on how EF works. So for that reason I have created a few tables. Questionnaire with a reference to Category and the Category has a reference to Question.</p>
  
  <p>What I notice here when I execute this code, I see in the profiler only the select statement of the questionnaire. But i am wondering, where is the query to get all the categories and questions? I can't find this query? I assume this must be visible in the profiler, right?</p>
  
  <p>EDIT:
  this is what I can get from the profiler:</p>
  
  <pre><code>SELECT TOP (1) 
  [Extent1].[id] AS [id], 
  [Extent1].[actualFrom] AS [actualFrom], 
  [Extent1].[name] AS [name], 
  [Extent1].[version] AS [version], 
  [Extent1].[startDate] AS [startDate], 
  [Extent1].[endDate] AS [endDate], 
  [Extent1].[description] AS [description], 
  [Extent1].[createdOn] AS [createdOn], 
  [Extent1].[createdBy] AS [createdBy], 
  [Extent1].[showQuestionCode] AS [showQuestionCode], 
  [Extent1].[font] AS [font], 
  [Extent1].[removed] AS [removed], 
  [Extent1].[showAchievementsAppointmentTab] AS [showAchievementsAppointmentTab], 
  [Extent1].[showConceptTabs] AS [showConceptTabs], 
  [Extent1].[f_QuestionnaireBuilder_QuestionnaireType_Id] AS [f_QuestionnaireBuilder_QuestionnaireType_Id], 
  [Extent1].[f_QuestionnaireBuilder_Status_Id] AS [f_QuestionnaireBuilder_Status_Id], 
  [Extent1].[f_QuestionnaireBuilder_Questionnaire_ParentId] AS [f_QuestionnaireBuilder_Questionnaire_ParentId], 
  [Extent1].[f_QuestionnaireBuilder_QuestionnaireCategory_Id] AS [f_QuestionnaireBuilder_QuestionnaireCategory_Id], 
  [Extent1].[f_Careplan_VisionModel] AS [f_Careplan_VisionModel]
  FROM [implementation].[QuestionnaireBuilder_Questionnaire] AS [Extent1]
  WHERE 169 = [Extent1].[id]
  </code></pre>