Refactor collection initializers to use C# 12 collection expressions

This commit updates various files across the Core and WebApp projects to replace traditional collection initializers with C# 12 collection expressions. Changes include modifications to EventAssignment.cs, TeamScheduler_DecisionTree.cs, CareerField.cs, EventDefinition.cs, and several components in the WebApp. These updates enhance code readability and maintainability by adhering to modern C# syntax standards.
This commit is contained in:
2026-01-11 10:35:58 -05:00
parent e53403c934
commit 8af86e22d9
20 changed files with 288 additions and 162 deletions
+3 -1
View File
@@ -71,7 +71,9 @@
.Include(e => e.Event)
.Include(e => e.Students)
.FirstOrDefaultAsync(m => m.Id == Id);
_students = await Context.Students.ToListAsync();
_students = await Context.Students
.AsNoTracking()
.ToListAsync();
_selectedStudents = Team?.Students.ToList();
if (Team is null)
@@ -218,6 +218,7 @@ else
{
_teams
= await Context.Teams
.AsNoTracking()
.Include(e => e.Event)
.Include(e => e.Students)
.OrderByEventFormatFirst()
@@ -228,6 +229,7 @@ else
_maxTeamSize = _teams.Max(t => t.Students.Count);
_students =
await Context.Students
.AsNoTracking()
.Include(e => e.Teams)
.ThenInclude(e => e.Captain)
.Include(e => e.EventRankings)