Fix formatting issue in Team entity and improve ToString method for null safety

This commit addresses a formatting issue in the Team.cs file by removing an invisible character at the beginning of the file. Additionally, the ToString method is updated to safely handle null values for the Event property, ensuring that it returns a default message when no event is associated with the team. These changes enhance code readability and prevent potential null reference exceptions.
This commit is contained in:
2026-01-25 21:59:16 -05:00
parent 9ab241ed77
commit bba0f5f618
+2 -2
View File
@@ -1,4 +1,4 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Core.Models; using Core.Models;
namespace Core.Entities; namespace Core.Entities;
@@ -61,6 +61,6 @@ public class Team
public override string ToString() public override string ToString()
{ {
return $"{Event.Name} {(Identifier != null ? $"({Identifier})" : "")}"; return $"{Event?.Name ?? "(no event)"} {(Identifier != null ? $"({Identifier})" : "")}";
} }
} }