1:1 OData ReferentialConstraint与错误的键

时间:2016-06-08 23:44:56

标签: c# asp.net-web-api odata odata-v3

我有两个实体f <- read.csv("storm_data_search_results.csv", header = TRUE, sep = ",") forder <- f[order(as.Date(f$BEGIN_DATE, format="%m")),] hist(forder$BEGIN_DATE) Customer是一对一的关系。客户有Address,地址有ID, AddressId, Name。每当我调用ID and AddressName时,元数据关联都会出现:

entityType.AddUnidirectionalNavigation(propertyOnEntity, propertyOnTargetEntity);

主要角色不应该<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> 作为AddressId吗?

1 个答案:

答案 0 :(得分:0)

不应该enum是依赖ID类型的外键吗?您不能通过Address引用Customer。因此,我认为AddressId是主要财产没有问题。有关您的参考,请参阅herehere