2016-06-08 2 views
0

CustomerAddress은 일대일 관계입니다. 고객은 ID, AddressId, Name이고 주소는 ID and AddressName입니다.잘못된 키가있는 1 : 1 OData ReferentialConstraint

<Association Name="K2SmartObjects_Customer_Address_K2SmartObjects_Address_Customer"> 
<End Type="K2SmartObjects.Address" Role="Address" Multiplicity="0..1"/> 
<End Type="K2SmartObjects.Customer" Role="Customer" Multiplicity="0..1"/> 
<ReferentialConstraint> 
<Principal Role="Customer"> 
<PropertyRef Name="ID"/> 
</Principal> 
<Dependent Role="Address"> 
<PropertyRef Name="ID"/> 
</Dependent> 
</ReferentialConstraint> 
</Association> 

가 주요 역할은 PropertyRefAddressId가 안 : 나는 entityType.AddUnidirectionalNavigation(propertyOnEntity, propertyOnTargetEntity);를 호출 할 때마다 메타 데이터 협회와 함께 나와?

답변

0

ID은 외래 키 Address 유형이어야합니까? AddressId을 통해 Customer을 참조하지 않았습니다. 따라서 ID이 주 속성 인 것은 문제가되지 않습니다. 자세한 내용은 herehere을 참조하십시오.