Skip to content

Commit

Permalink
Add note about omission of .AsNoTracking (#14031)
Browse files Browse the repository at this point in the history
  • Loading branch information
tdykstra committed Aug 27, 2019
1 parent 92d99bc commit 627664d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion aspnetcore/data/ef-mvc/read-related-data.md
Expand Up @@ -234,7 +234,7 @@ Suppose you expected users to only rarely want to see enrollments in a selected

[!code-csharp[](intro/samples/cu/Controllers/InstructorsController.cs?name=snippet_ExplicitLoading&highlight=23-29)]

The new code drops the *ThenInclude* method calls for enrollment data from the code that retrieves instructor entities. If an instructor and course are selected, the highlighted code retrieves Enrollment entities for the selected course, and Student entities for each Enrollment.
The new code drops the *ThenInclude* method calls for enrollment data from the code that retrieves instructor entities. It also drops `AsNoTracking`. If an instructor and course are selected, the highlighted code retrieves Enrollment entities for the selected course, and Student entities for each Enrollment.

Run the app, go to the Instructors Index page now and you'll see no difference in what's displayed on the page, although you've changed how the data is retrieved.

Expand Down

0 comments on commit 627664d

Please sign in to comment.