Hej,Problem med association i Entity Framework
Jag har två tabeller som jag försöker göra en association mellan i EF.
Tabeller:
tbl_counter_program_map
-counterpmapProgramId varchar(64)
-counterpmapCounterId varchar(64)
tbl_counter_oid
-counterId varchar(64)
-counterType
.
.
.
Jag har kopplat ihop dem med följande association:
<Association Name="tbl_counter_program_maptbl_counter_oid">
<End Role="tbl_counter_program_map" Type="Cirrato_ExactCopyModel.tbl_counter_program_map" Multiplicity="1" />
<End Role="tbl_counter_oid" Type="Cirrato_ExactCopyModel.tbl_counter_oid" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="tbl_counter_program_map">
<PropertyRef Name="counterpmapCounterId" />
</Principal>
<Dependent Role="tbl_counter_oid">
<PropertyRef Name="counterId" />
</Dependent>
</ReferentialConstraint>
</Association>
Får dock felet:
Error 111: Properties referred by the Principal Role tbl_counter_program_map must be exactly identical to the key of the EntityType Cirrato_ExactCopyModel.tbl_counter_program_map referred to by the Principal Role in the relationship constraint for Relationship Cirrato_ExactCopyModel.tbl_counter_program_maptbl_counter_oid. Make sure all the key properties are specified in the Principal Role.
Tacksam för lite hjälp då det känns som jag testat allt och inget funkar.