Skip to content

Commit 6e499c1

Browse files
Copilottdykstra
andauthored
Fix incorrect SelectList selected item documentation and misleading comments (#36032)
* Initial plan * Fix SelectList selected item documentation and misleading comments Co-authored-by: tdykstra <1569635+tdykstra@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tdykstra <1569635+tdykstra@users.noreply.github.com>
1 parent c023fca commit 6e499c1

File tree

13 files changed

+26
-24
lines changed

13 files changed

+26
-24
lines changed

aspnetcore/data/ef-rp/intro/samples/cu-completed-stages/part7/ContosoUniversity/Pages/Courses/Create.cshtml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public async Task<IActionResult> OnPostAsync()
4343
return RedirectToPage("./Index");
4444
}
4545

46-
// Select DepartmentID if TryUpdateModelAsync fails.
46+
// Repopulate departments dropdown. emptyCourse.DepartmentID determines the selected item.
4747
PopulateDepartmentsDropDownList(_context, emptyCourse.DepartmentID);
4848
return Page();
4949
}

aspnetcore/data/ef-rp/intro/samples/cu-completed-stages/part7/ContosoUniversity/Pages/Courses/Edit.cshtml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public async Task<IActionResult> OnGetAsync(int? id)
3232
return NotFound();
3333
}
3434

35-
// Select current DepartmentID.
35+
// Populate departments dropdown. Course.DepartmentID determines the selected item.
3636
PopulateDepartmentsDropDownList(_context, Course.DepartmentID);
3737
return Page();
3838
}
@@ -60,7 +60,7 @@ public async Task<IActionResult> OnPostAsync(int? id)
6060
return RedirectToPage("./Index");
6161
}
6262

63-
// Select DepartmentID if TryUpdateModelAsync fails.
63+
// Repopulate departments dropdown. courseToUpdate.DepartmentID determines the selected item.
6464
PopulateDepartmentsDropDownList(_context, courseToUpdate.DepartmentID);
6565
return Page();
6666
}

aspnetcore/data/ef-rp/intro/samples/cu/Pages/Courses/Create.cshtml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public async Task<IActionResult> OnPostAsync()
4141
return RedirectToPage("./Index");
4242
}
4343

44-
// Select DepartmentID if TryUpdateModelAsync fails.
44+
// Repopulate departments dropdown. emptyCourse.DepartmentID determines the selected item.
4545
PopulateDepartmentsDropDownList(_context, emptyCourse.DepartmentID);
4646
return Page();
4747
}

aspnetcore/data/ef-rp/intro/samples/cu/Pages/Courses/Edit.cshtml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public async Task<IActionResult> OnGetAsync(int? id)
3232
return NotFound();
3333
}
3434

35-
// Select current DepartmentID.
35+
// Populate departments dropdown. Course.DepartmentID determines the selected item.
3636
PopulateDepartmentsDropDownList(_context,Course.DepartmentID);
3737
return Page();
3838
}
@@ -55,7 +55,7 @@ public async Task<IActionResult> OnPostAsync(int? id)
5555
return RedirectToPage("./Index");
5656
}
5757

58-
// Select DepartmentID if TryUpdateModelAsync fails.
58+
// Repopulate departments dropdown. courseToUpdate.DepartmentID determines the selected item.
5959
PopulateDepartmentsDropDownList(_context, courseToUpdate.DepartmentID);
6060
return Page();
6161
}

aspnetcore/data/ef-rp/intro/samples/cu20snapshots/cu-part7/Pages/Courses/Create.cshtml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public async Task<IActionResult> OnPostAsync()
5353
return RedirectToPage("./Index");
5454
}
5555

56-
// Select DepartmentID if TryUpdateModelAsync fails.
56+
// Repopulate departments dropdown. emptyCourse.DepartmentID determines the selected item.
5757
PopulateDepartmentsDropDownList(_context, emptyCourse.DepartmentID);
5858
return Page();
5959
}

aspnetcore/data/ef-rp/intro/samples/cu20snapshots/cu-part7/Pages/Courses/Edit.cshtml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public async Task<IActionResult> OnGetAsync(int? id)
3838
return NotFound();
3939
}
4040

41-
// Select current DepartmentID.
41+
// Populate departments dropdown. Course.DepartmentID determines the selected item.
4242
PopulateDepartmentsDropDownList(_context, Course.DepartmentID);
4343
return Page();
4444
}
@@ -61,7 +61,7 @@ public async Task<IActionResult> OnPostAsync(int? id)
6161
return RedirectToPage("./Index");
6262
}
6363

64-
// Select DepartmentID if TryUpdateModelAsync fails.
64+
// Repopulate departments dropdown. courseToUpdate.DepartmentID determines the selected item.
6565
PopulateDepartmentsDropDownList(_context, courseToUpdate.DepartmentID);
6666
return Page();
6767
}

aspnetcore/data/ef-rp/intro/samples/cu20snapshots/cu-part8/Pages/Courses/Create.cshtml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public async Task<IActionResult> OnPostAsync()
5353
return RedirectToPage("./Index");
5454
}
5555

56-
// Select DepartmentID if TryUpdateModelAsync fails.
56+
// Repopulate departments dropdown. emptyCourse.DepartmentID determines the selected item.
5757
PopulateDepartmentsDropDownList(_context, emptyCourse.DepartmentID);
5858
return Page();
5959
}

aspnetcore/data/ef-rp/intro/samples/cu20snapshots/cu-part8/Pages/Courses/Edit.cshtml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public async Task<IActionResult> OnGetAsync(int? id)
3838
return NotFound();
3939
}
4040

41-
// Select current DepartmentID.
41+
// Populate departments dropdown. Course.DepartmentID determines the selected item.
4242
PopulateDepartmentsDropDownList(_context, Course.DepartmentID);
4343
return Page();
4444
}
@@ -61,7 +61,7 @@ public async Task<IActionResult> OnPostAsync(int? id)
6161
return RedirectToPage("./Index");
6262
}
6363

64-
// Select DepartmentID if TryUpdateModelAsync fails.
64+
// Repopulate departments dropdown. courseToUpdate.DepartmentID determines the selected item.
6565
PopulateDepartmentsDropDownList(_context, courseToUpdate.DepartmentID);
6666
return Page();
6767
}

aspnetcore/data/ef-rp/intro/samples/cu30/Pages/Courses/Create.cshtml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public async Task<IActionResult> OnPostAsync()
3636
return RedirectToPage("./Index");
3737
}
3838

39-
// Select DepartmentID if TryUpdateModelAsync fails.
39+
// Repopulate departments dropdown. emptyCourse.DepartmentID determines the selected item.
4040
PopulateDepartmentsDropDownList(_context, emptyCourse.DepartmentID);
4141
return Page();
4242
}

aspnetcore/data/ef-rp/intro/samples/cu30/Pages/Courses/Edit.cshtml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public async Task<IActionResult> OnGetAsync(int? id)
3232
return NotFound();
3333
}
3434

35-
// Select current DepartmentID.
35+
// Populate departments dropdown. Course.DepartmentID determines the selected item.
3636
PopulateDepartmentsDropDownList(_context, Course.DepartmentID);
3737
return Page();
3838
}
@@ -60,7 +60,7 @@ public async Task<IActionResult> OnPostAsync(int? id)
6060
return RedirectToPage("./Index");
6161
}
6262

63-
// Select DepartmentID if TryUpdateModelAsync fails.
63+
// Repopulate departments dropdown. courseToUpdate.DepartmentID determines the selected item.
6464
PopulateDepartmentsDropDownList(_context, courseToUpdate.DepartmentID);
6565
return Page();
6666
}

0 commit comments

Comments
 (0)