How Model n--n relationship in EF Code First to automatically generated views work correctly?

前端 未结 4 1464
离开以前
离开以前 2021-01-11 21:20

I use EF Code First and have a problem in n-n relationship, assume we have a singer that sing in some genres, so we need this models: Artist, Genre, and ArtistsGenres, I def

4条回答
  •  走了就别回头了
    2021-01-11 21:43

    The connection between Artist and genres is the ArtistsGenre.

    So artist containt: ID, Name

    And Genre contains: ID, Title

    And ArtistsGenre contains: ID artist, ID genre

提交回复
热议问题