Forum:  Bugs & Issues

Thread:  Attribute not emitted


yowl (User)   Posted on: 30-Jan-2019 14:55:58.
Hi,

Is there a problem with attributes on fields mapped to related fields using NetStandard preset?

I have this in the proj file:
Code:

        <Forfs>
         <Forf Name="CompanyName" MappedField="Reference:Company:Name" RelationshipName="Reference.ClientAccountCompany.Company-Reference.Company.ClientAccountCompanies" ViaStartNavigator="true" IsReadOnly="true">
            <OutputSettingValues>
             <Attributes>
                <Attribute Value="XmlIgnore" />
                <Attribute Value="someotherthing" />
             </Attributes>
            </OutputSettingValues>
         </Forf>
        </Forfs


But when generating the c# the attributes are not there.

LLBLGen 5.5
Adapter
Preset SD.Presets.Adapter.General.Netstandard
Target Platform netstandard 2.0 c#
Runtime framework: LLBLGen
yowl (User)   Posted on: 30-Jan-2019 15:16:32.
I tried .net 4.7 and the standard preset and also didn't get the attribute, maybe I've forgotten something basic about how this works, seems fine on ordinary fields though.

yowl (User)   Posted on: 30-Jan-2019 16:11:20.
It pulls the attributes from the related entity, which seems odd. Template is

Code:
        /// <summary>Gets <[ If Not IsReadOnly ]>/ Sets <[ EndIf ]>the value o xxxxxf the related field this.<[ MappedFieldNameRelation ]>.<[ RelatedEntityFieldName ]>.<br/><br/><[Foreach CustomProperty RelatedEntityField]><[CustomPropertyName]>: <[CustomPropertyValue]><br/><[NextForeach]><[Description]></summary><[Foreach Attribute RelatedEntityField]>
    aaaa    <[Attribute]><[NextForeach]


I've added some instrumentation to try to see what was going on.
yowl (User)   Posted on: 30-Jan-2019 16:46:50.
here's a sample project. Codegen it and you'll see that the resulting AlertEntity on its mapped field, AgreedAmt, has the attributes from the ClaimEntity, not one set in the designer for the AlertEntity.

Otis (LLBLGen Pro Team)   Posted on: 30-Jan-2019 17:13:37.
It indeed pulls them from the related field. The problem is: we can't change this now, as it's a breaking change. See: https://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=26587

It's scheduled to be fixed in v5.6 as we can break things there. Please read the thread above for more details. I'm going to close this thread now, not because we don't want to fix the issue, we do want to fix it, but because it's already reported and we can't do much else than fix it in v5.6 as it's a breaking change.

Sorry for this inconvenience...
yowl (User)   Posted on: 30-Jan-2019 17:14:59.
Thanks for the quick reply.