diff --git a/EntityFrameworkCore.Domain/Coach.cs b/EntityFrameworkCore.Domain/Coach.cs index b35c6b4..c7e4977 100644 --- a/EntityFrameworkCore.Domain/Coach.cs +++ b/EntityFrameworkCore.Domain/Coach.cs @@ -3,6 +3,6 @@ public class Coach : BaseDomainModel { public string Name { get; set; } // Strings are automatically become VARCHAR database types. - public int? TeamId { get; set; } + public Team? Team { get; set; } } diff --git a/EntityFrameworkCore.Domain/Team.cs b/EntityFrameworkCore.Domain/Team.cs index e6e8aa7..495aa34 100644 --- a/EntityFrameworkCore.Domain/Team.cs +++ b/EntityFrameworkCore.Domain/Team.cs @@ -5,7 +5,8 @@ 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 HomeMatches { get; set; } - public List AwayMatches { get; set; } + public List HomeMatches { get; set; } = new List() { }; + public List AwayMatches { get; set; } = new List() { }; }