note Select is used to project elements into a sequence
Maintainer thường phản hồi trong vòng 1 ngày
@tdykstra đang làm issue này rồi.
Từ ngày 21/5/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Description
In the section: Loading related data with Select,
I am not sure how the Select function really fits into the context of the differences between eager and lazy loading. (I've always been a little fuzzy here. I just always use eager loading when I need a nav prop filled)
But if this example should go here I would explain the fact that the Selection function being used here projects elements of a sequence into a new form be it a view model or a var variable capable of holding an anonymous type.
Your View Model projection example:
public IList CourseVM { get; set; }
public async Task OnGetAsync()
{
CourseVM = await _context.Courses
.Select(p => new CourseViewModel
{
CourseID = p.CourseID,
Title = p.Title,
Credits = p.Credits,
DepartmentName = p.Department.Name
}).ToListAsync();
}
My inline anonymous object example:
var coursesProjected = await _context.Courses
.Select(p => new
{
CourseID = p.CourseID,
Title = p.Title,
Credits = p.Credits,
DepartmentName = p.Department.Name
}).ToListAsync();
coursesProjected has to be of type var here to work.
Page URL
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/data/ef-rp/read-related-data.md
Document ID
3cb264da-2ff1-1256-572f-aa4ebca6e255
Platform Id
5d8ba75a-678a-21ac-469c-05e8afe24128
Article author
@tdykstra
Metadata
- ID: d0026f69-7e5d-0d3e-5586-16ecc0656ff0
- PlatformId: 5d8ba75a-678a-21ac-469c-05e8afe24128
- Service: aspnet-core
- Sub-service: data-access
- Ngôn ngữ chính
- C#
- Star
- 13.1k
- Fork
- 24.5k
- Merge trung bình
- 3 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 210
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của dotnet/AspNetCore.Docs
-
aspnet-core/svc doc-enhancement mvc/subsvc Pri2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
dotnet/AspNetCore.Docs#38016 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Update sample app and articleĐang mởaspnet-core/svc doc-enhancement hosting-deployment/subsvc Pri2 Source - Docs.ms
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
dotnet/AspNetCore.Docs#38009 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
:watch: Not Triaged CAC
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
dotnet/AspNetCore.Docs#38000 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
:watch: Not Triaged CAC
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
dotnet/AspNetCore.Docs#37998 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[AI-Suggested] Content update request from UUF signal: Build a Blazor movie database app (Part 1 - Create a Blazor Web App) | Microsoft LearnCó thể đã có người làm @guardrex đã nhận 5 ngày trước. Đang mở:watch: Not Triaged CAC
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
dotnet/AspNetCore.Docs#37995 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của dotnet/AspNetCore.Docs
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Исправить опечатки в протоколеĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 76/100
GameShowLDA/AskMkiM#1075 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
kind/bug triage/untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
unoplatform/uno.resizetizer#414 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày