Update read-related-data.md (#17773)

* Update read-related-data.md

Add an explanation of why AsNoTracking method was not used.
Fix #17764

* Update read-related-data.md

* Update read-related-data.md

Co-authored-by: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com>
pull/17781/head
Hamid Molareza 2020-04-14 04:55:12 +04:30 committed by GitHub
parent a97478f0a3
commit 2239b40568
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -132,6 +132,8 @@ The following code loads related data with the `Select` method:
[!code-csharp[](intro/samples/cu30snapshots/6-related/Pages/Courses/IndexSelect.cshtml.cs?name=snippet_RevisedIndexMethod&highlight=6)]
The preceding code doesn't return any entity types, therefore no tracking is done. For more information about the EF tracking, see [Tracking vs. No-Tracking Queries](/ef/core/querying/tracking).
The `CourseViewModel`:
[!code-csharp[](intro/samples/cu30snapshots/6-related/Models/SchoolViewModels/CourseViewModel.cs?name=snippet)]