Hi there,
I have a custom template and I'm looping through Many To One RelatedEntities but can't figure out how to access the FKey field of the currentEntity that represents the relation.
Here's the entity template code:
<[Foreach RelatedEntity ManyToOne]><[If Not MappedFieldRelationIsHidden]>
<[RelatedEntityName]> f<[MappedFieldNameRelation]>;
[Association("<[RelatedMappedFieldNameRelation]>-<[RelatedEntityName]>-<[CurrentEntityName]>")]
[Persistent("<[RelatedEntityFieldName]>")] // I need the fkey Field in this entity which represents the current relation here
public <[RelatedEntityName]> <[MappedFieldNameRelation]>
{
get { return f<[MappedFieldNameRelation]>; }
set { SetPropertyValue<<[RelatedEntityName]>>("<[MappedFieldNameRelation]>", ref f<[MappedFieldNameRelation]>, value); }
}<[EndIf]><[NextForeach]>
Example code of what I need:
public ContactEntity
{
public int cTypeID; // fkey to CType table
// relation property
[Persistent("cTypeID")] // can't get 'cTypeID' when looping through related entities
public CType ContactType;
}
Using Template Studio: 2.6.06102008 Final