EF6을 사용하여 MVC5 인터넷 응용 프로그램을 코딩 중이며 외래 키 이름과 관련하여 질문이 있습니다.Entity Framework 6 외래 키
public int mapLocationListGalleryId { get; set; }
public virtual MapLocationListGallery mapLocationListGallery { get; set; }
EF 테이블을 생성 할 때,이 모두 다음과 같은 열 :
나는이 두 필드가 MapLocationList
라는 모델이
- 는
- 는
누군가 제발 explai 수 있습니다. n MapLocationListGallery
외래 키에 대해 두 개의 열이있는 이유는 무엇입니까? 사전
편집에
덕분에
내가 대문자 M을 사용하기 위해 이름을 변경, 아직 추가 열이 아직도있다. 나뿐만 아니라이 방법을 사용하고 난이 문제가 발생하지 않습니다
modelBuilder.Entity<MapLocationListGallery>()
.HasRequired(c => c.thumbnailAsset)
.WithMany()
.WillCascadeOnDelete(false);
modelBuilder.Entity<MapLocationList>()
.HasRequired(c => c.thumbnailAsset)
.WithMany()
.WillCascadeOnDelete(false);
modelBuilder.Entity<MapLocationList>()
.HasRequired(c => c.mapLocationListGallery)
.WithMany()
.WillCascadeOnDelete(false);
modelBuilder.Entity<MapLocationListItem>()
.HasRequired(c => c.thumbnailAsset)
.WithMany()
.WillCascadeOnDelete(false);
내 게시물에 몇 가지 추가 정보를 추가했습니다. – user3736648