Attribute not emitted

Posts   
 
    
yowl
User
Posts: 266
Joined: 11-Feb-2008
# 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:


        <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
Posts: 266
Joined: 11-Feb-2008
# 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
Posts: 266
Joined: 11-Feb-2008
# Posted on: 30-Jan-2019 16:11:20   

It pulls the attributes from the related entity, which seems odd. Template is

        /// <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
Posts: 266
Joined: 11-Feb-2008
# 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.

Attachments
Filename File size Added on Approval
testatt2.llblgenproj 36,732 30-Jan-2019 16:47.40 Approved
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# 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...

Frans Bouma | Lead developer LLBLGen Pro
yowl
User
Posts: 266
Joined: 11-Feb-2008
# Posted on: 30-Jan-2019 17:14:59   

Thanks for the quick reply.