How to define a reflexive assocation in CodeFluent

63 Views Asked by At

What is the proper way to define a reflexive assocation in code fluent. Given this example, the design shows up correctly, but the generation would struggle with enclosed error message:

Error CF0036: Type for property 'OldEntityA' of entity 'Namespace.EntityA' must be a project entity if 'relationPropertyName' attribute is specified.

<cf:entity name="EntityA" namespace="Namespace" categoryPath="/Category">
<cf:property name="Id" key="true" collectionKey="false" />
<cf:property name="Url" collectionKey="false" />
<cf:property name="OldEntityA" typeName="Namespace.EntityA" relationPropertyName="Unspecified" collectionKey="false" />

Thanks in advance,

1

There are 1 best solutions below

0
On BEST ANSWER

You must remove the relationPropertyName attribute or set its value to a valid property name:

<cf:entity name="Category">
  <cf:property name="Id" key="true" />
  <cf:property name="Name" />
  <cf:property name="Parent" typeName="{0}.Category" relationPropertyName="Children" />
  <cf:property name="Children" typeName="{0}.CategoryCollection" relationPropertyName="Parent" />
</cf:entity>