eugene wrote:
Dear Otis,
I just checked the template for derivedEntityAdapter.template.
Are you suggesting something like the follwing?
<[Foreach RelatedEntity ManyToOne]><[If Not MappedFieldRelationIsHidden]>
/// <summary>
/// </summary>
[Browsable(false)]
public new virtual My<[RelatedEntityName]>Entity <[MappedFieldNameRelation]>
{
get
{
return (My<[RelatedEntityName]>Entity)base.<[MappedFieldNameRelation]>;
}
set
{
base.<[MappedFieldNameRelation]> = value;
<[ UserCodeRegion "EntityMember" ]>
// __LLBLGENPRO_USER_CODE_REGION_START EntityMember
// __LLBLGENPRO_USER_CODE_REGION_END
<[ EndUserCodeRegion ]>
}
}
<[EndIf]><[NextForeach]>
A question:
Do I need a seperate region pro member or is it possible to have a region defined at multiple positions within an emmitted document?
The region's contents in the current file is retrieved using the name of the region so if you have multiple times the same region, it will end up in not that great code.
You can pass in a usercoderegion name based on a value like MappedFieldNameRelation, using another version of UserCodeRegion, see the SDK docs for details on that statement.
For example I'd suggest here:
<[Foreach RelatedEntity ManyToOne]><[If Not MappedFieldRelationIsHidden]>
/// <summary>
/// </summary>
[Browsable(false)]
public new virtual My<[RelatedEntityName]>Entity <[MappedFieldNameRelation]>
{
get
{
return (My<[RelatedEntityName]>Entity)base.<[MappedFieldNameRelation]>;
}
set
{
base.<[MappedFieldNameRelation]> = value;
<[ UserCodeRegion StringValueEquals "MappedFieldNameRelation" "($VALUE)Setter" ]>
// __LLBLGENPRO_USER_CODE_REGION_START <[UserCodeRegionName]>
// __LLBLGENPRO_USER_CODE_REGION_END
<[ EndUserCodeRegion ]>
}
}
<[EndIf]><[NextForeach]>