Kevin Matsubara b0e653ab0d Add one to one relationship between Coach and Team.
A Coach is parent, Team is child.
A Coach can exist on his own, without a Team, but a Team cannot play without a Coach.
2025-04-07 11:21:48 +02:00

13 lines
467 B
C#

namespace EntityFrameworkCore.Domain;
// Since C#11, you do not need to wrap in accolades anymore.
public class Team : BaseDomainModel
{
public string? Name { get; set; }
public League? League { get; set; }
public int? LeagueId { get; set; }
public Coach Coach { get; set; }
public int CoachId { get; set; }
public List<Match> HomeMatches { get; set; } = new List<Match>() { };
public List<Match> AwayMatches { get; set; } = new List<Match>() { };
}