0
"StaffSectionInCharge"테이블에 일부 레코드를 추가해야하는데 StaffId 및 SectionId라는 두 개의 열만 있습니다. StaffId 및 StudentId 값이 있습니다. 문제는 내가 추가 할 수 없습니다. 이 테이블에 직접 기록 엔티티 프레임 워크를 사용하고 있습니다 .....이 테이블의 디자인은 내가 직원 테이블을 통해이 테이블에 액세스 할 필요가데이터베이스에 값을 저장합니다
[EdmRelationshipNavigationPropertyAttribute("Model", "StaffSectionInCharge", "Section")]
public EntityCollection<Section> Sections
{
get
{
return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<Section>("Model.StaffSectionInCharge", "Section");
}
set
{
if ((value != null))
{
((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<Section>("Model.StaffSectionInCharge", "Section", value);
}
}
}
, 나는
DataAccess.Staff staff = buDataEntities.Staffs.First(s=>s.StaffId==StaffId);
staff.Sections.Add();
오전 stucking 같은 시도 여기, 그리고 더 이상 움직일 수없는 사람, 아무도 날 여기 도와 줄 수 없다
큰, 그 작업은 ........... – shanish
alottt 덕분에 내가 어떻게 ...... 통과하고있는 ID가 데이터베이스에 이미 존재하는지 여부 유를 할 수 있습니다 확인하실 수 있습니다 도와주세요 – shanish
@Shanish :이 질문을 새로운 질문으로 제공해 줄 수 있습니까? 코멘트 섹션에서 대답하기가 더 어렵습니다. – Slauma