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:
@@ -174,6 +174,7 @@
|
||||
{
|
||||
// Load all students with their teams
|
||||
var students = await Context.Students
|
||||
.AsNoTracking()
|
||||
.Include(s => s.Teams)
|
||||
.ThenInclude(t => t.Event)
|
||||
.Include(s => s.Teams)
|
||||
@@ -270,7 +271,7 @@
|
||||
Student = student,
|
||||
Events = student.Teams?.Where(t => t?.Event != null)
|
||||
.Select(t => t.Event)
|
||||
.ToList() ?? new List<EventDefinition>()
|
||||
.ToList() ?? []
|
||||
};
|
||||
|
||||
return ValidationService.ValidateStudentStatistics(stats, ValidationContext.StudentRegistration);
|
||||
|
||||
Reference in New Issue
Block a user