오케스트라 계획 도구에 대한 엔티티 관계 데이터 모델을 개발 중입니다. 최종 결과는 ASP.NET/MVC4 응용 프로그램이어야합니다. 제가 Event
및 Composition
사이 대다 관계가 있음을 시각화하려고 위에다 - 대 - 다 관계 코드를 첫 번째 스타일로 설정하는 방법은 무엇입니까?
이미지에서 :
이 내 E/R-도의 일부이다. 내 모델에서 나는 Event
의 Composition
의 녹음을 저장할 수있는 가능성을 원한다. (다른 이벤트/콘체르토의 매우 다른 녹음 된 버전이 많이있을 수있다.)
public class Composition
{
public Composition()
{
Instruments = new Collection<Instrument>();
Events = new Collection<Event>();
}
[Key]
public int Id { get; set; }
public bool Active { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public TimeSpan Durata { get; set; }
public virtual Composer Composer { get; set; }
public virtual Composer Genre { get; set; }
public virtual ICollection<Instrument> Instruments { get; set; }
public virtual ICollection<Event> Events { get; set; }
}
_
public class Event
{
public Event()
{
Compositions = new Collection<Composition>();
Members = new Collection<Member>();
}
[Key]
public int Id { get; set; }
public bool Active { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public DateTime StartDate { get; set; }
public DateTime EndDate { get; set; }
public virtual ICollection<Member> Members { get; set; }
public virtual ICollection<Composition> Compositions { get; set; }
public virtual Calendar Calendar { get; set; }
public virtual EventType EventType { get; set; }
public virtual Location Location { get; set; }
}
내 질문 : 내 코드에서 할 다음
내가 (내 코드 첫 번째 데이터 모델에 대한 관련 코드) 지금까지 한 일이다 관계 특성 "녹음"을 추가합니까?편집 : 링크 테이블을 만들어야합니까, 아니면 더 좋은 대안이 있습니까?
링크 Thx. 나는 이것을 답으로 표시하기 전에 몇 가지 테스트를해야한다. –
답변 틱을 주셔서 감사합니다. – Tasio