We have a file format we need to parse that looks like:
v1|000|sammy|endpoint|blah
It's an ordered fixed-width format a vendor provides to us, so each of those 5 fields maps to a specific property in the class (the actual format has >30).
I'd like to just parse this with Reflection by applying sequence to the properties. One way I could do this is to just make something up myself - write an Attribute class that takes a single number, and apply that attribute to each property with its sequence index, and look for it during Reflection in the OrderBy clause.
Is there an existing or better way to do this in C#? For example, is there already an Attribute for this? Is there a way to ask in C# or maybe even MSIL what order properties were declared in a class?