Many-to-many mapping with extra columns in join table

前端 未结 5 1091
慢半拍i
慢半拍i 2021-01-22 00:51

Here is the domain that I wish to have:

public class Person
{
    public int Id { get; set; }
    public IList AcquiredCertificates {          


        
5条回答
  •  半阙折子戏
    2021-01-22 01:27

    Your implementation is exactly correct. Your join table includes the two key fields (making a composite primary key for the table) and the datetime field is superfluous to that. It is in fact an extra attribute on the join table and for that you need an entity.

    On a UML class diagram it would show up as an attribute on the join too.

提交回复
热议问题