Many-to-many relationship in oop

后端 未结 7 748
北恋
北恋 2021-02-04 15:53

what is best way to model many-to-many relationship?

lets say we have a two classes , Team and Player

  • any given P
7条回答
  •  时光说笑
    2021-02-04 16:06

    public class Player
    {
      public Team[] Teams {get;set;}
    }
    
    public class Team
    {
      public Player[] Players {get;set;}
    }
    

    Perfectly reasonable.

提交回复
热议问题