예를 들어 다음 데이터베이스 모델을 고려해보십시오.Entity Framework를 사용한 연결 상속
- USERTABLE (ID, 이름)
- TextContentTable (ID, 이름, 설명 CreatedByUserId, ModifiedByUserId,는 TextContent)
- ImageContentTable (ID, 이름, 설명 CreatedByUserId, ModifiedByUserId, ImageContent)
다음 개체 모델을 만들고 싶습니다. 그러나 그것은 가능한가?
- BaseEntity (ID)
- DescriptiveEntity (이름, 설명) : 예를 들어 BaseEntity
- TrackedEntity (CreatedBy, ModifiedBy) : DescriptiveEntity
- 사용자 (아이디) : BaseEntity
- TextContent (텍스트) : TrackedEntity
- ImageContent (이미지) : TrackedEntity
내 표기법을 이해하고 있지만 (굵게 표시된) 연결을 개별 테이블에 매핑 할 수 있습니까? TextContentTable & ImageContentTable?
고지.
나는 귀하의 표기법을 이해한다고 생각합니다. 어떻게 CreatedBy와 ModifiedBy를 두 테이블에 매핑 할 수 있습니까? 내가 읽은 방법은 ImageContentTable에만 ModifiedByUserId가 있습니까? 그게 실수였습니까? –
Oeps 실수로 제 질문을 수정하겠습니다. TextContentTable에는 ModifiedByUserId 열도 있어야합니다. – JSC