question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MemberConfiguration.Order / Attribute Order

See original GitHub issue

Hi, I would like to specify the Order of the attributes using Profiles, like: .Member(x => x.C).Name(“Cc”).Order(0). .Member(x => x.B).Name(“Bb”).Order(1)

For some reason it doesn’t work for parent element, but it does work for child elements. I’m sure I’m missing something obvious. The whole code is here: https://gist.github.com/Lux44/265d485c04a707fe72f853a0d8cda8bb

Desired xml:

 <OuterDataThings>
  <Cc>C</Cc>
  <Bb>B</Bb>
  <Aa>A</Aa>
</OuterDataThings>

Actual xml:

<OuterDataThings>
  <Aa>A</Aa>
  <Bb>B</Bb>
  <Cc>C</Cc>
</OuterDataThings>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
AndresLugacommented, Jan 17, 2020

Works as expected, thank you very much!

0reactions
Mike-E-angelocommented, Jan 18, 2020

This is now available on NuGet: https://www.nuget.org/packages/ExtendedXmlSerializer/

<div>ExtendedXmlSerializer 3.1.0</div><div>An extensible Xml Serializer for .NET that builds on the functionality of the classic XmlSerializer with a powerful and robust extension model.</div>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Does GetCustomAttributes() preserve the attribute order in . ...
When I'm doing some reflection through my classes, will the MemberInfo.GetCustomAttributes() method preserve the order of attributes on a member ...
Read more >
Attribute Mapping
To declare an attribute map, decorate your destination type with the AutoMapAttribute : [AutoMap(typeof(Order))] public class OrderDto { // destination ...
Read more >
How to order attributes by suffix in FME?
Use a ListSorter on the Schema Feature, sort on attribute{}.name. Connect the Schema Feature and the Data Features to a Sorter to make...
Read more >
06 - Member Configuration - Xandr Documentation Center
This setting, stored in the "use_insertion_orders" parameter, specifies whether or not insertion orders should be used on all advertisers ...
Read more >
Use Custom Attributes for Orders
Learn how to create and manage custom attributes for Square orders using the Order Custom Attributes API.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found