EDI.Net icon indicating copy to clipboard operation
EDI.Net copied to clipboard

Deserialize of X12 does not work on deeply nested segmentgroups

Open tpod opened this issue 3 years ago • 1 comments

After checking a lot of old issues and documentation I'm fairly sure how to structure the mapping. Although I may have a mistake.

But for some reason mapping stops working on deeply nested object (INSLoop works ok, but one deeper NM1Loop does not). Please check the pullrequest and test for details.

@cleftheris hope you can find whats wrong.

Thanks!

tpod avatar Mar 02 '22 13:03 tpod

If you referring to a 2100 loop (NM1 loop), this is how I got it to work.

 [EdiSegmentGroup("INS", SequenceEnd = "SE"), EdiElement]
    public class Loop2000 : INS
    {
        public List<REF> REFs { get; set; }

        public List<DTP> DTPs { get; set; }

        public List<Loop2100> Loop2100s { get; set; } 
        ...
      }

 [EdiSegmentGroup("NM1", new[] { "PER", "N3", "N4", "DMG", "EC", "ICM", "AMT", "HLH", "HI", "LUI" })]
    public class Loop2100 : NM1
    {
        public PER PER { get; set; }
        public N3 N3 { get; set; }
        public N4 N4 { get; set; }
        ...
     }

tcsyring avatar Apr 21 '22 13:04 tcsyring