indice-co / indice-co/EDI.Net

Does EdiSegmentGroup care about ordering?

Open
#217 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C#
Stars
490
Forks
173
PR merge metrics
No merged PRs in 30d

Description

Hi,

I have a question regarding ordering in EdiSegmentGroup. This is from X12_850.cs. As you can see the order is N1,N2,N3,N4.

```c#
[EdiSegmentGroup("N1", "N2", "N3", "N4", Description = "N - Addresses")]
public class Address
{
[EdiValue(Path = "N1/0", Description = "N101 - Address Code")]
public string AddressCode { get; set; }

[EdiValue(Path = "N1/1", Description = "N102 - Address Name")]
public string AddressName { get; set; }

[EdiValue(Path = "N3/0", Description = "N301 - Address Information")]
public string AddressInformation { get; set; }

[EdiValue(Path = "N4/0", Description = "N401 - City Name")]
public string CityName { get; set; }

[EdiValue(Path = "N4/3", Description = "N404 - Country Code")]
public string CountryCode { get; set; }
}
```

However when I read a data

```
N1*N101*N102*92*0857673380000~
N4*N401*UT*98034*N404~
N3*N301#2~
```

It would read all 3 N values even though N3 is in the wrong order. Is this the intended behavior? I was expecting it to read N1 and N4 and then skip N3.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with X12_850.cs and the EdiSegmentGroup definition, then trace how the deserializer handles the N1, N2, N3, and N4 sequence. Confirm whether an out-of-order N3 should be accepted or skipped; done means establishing and testing the intended ordering behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.