EDI.Net
EDI.Net copied to clipboard
Optional EdiValue segments in segment group generate empty lines
Hello! I have an issue with serializer when defining segments in segment groups like this:
[EdiSegmentGroup(.....)]
public class SG
{
...
[EdiValue("X(100)", Path = "FTX/0")]
public string Aaa { get; set; }
public LOC Bbb { get; set; }
...
}
Both properties are nulls (they are optional) and they must not be in the EDI document, but I get line FTX+'
instead. This can be fixed by moving Aaa
to separate segment class similar to Bbb
, but it's just excess code in my case. I want to keep those optional single-parameter segments in segment group class.
Is this by design?
@cleftheris did you check this?
Hi @GVG This is not supported at the moment. This could be an improvement in the way compression is handled inside the EdiWriter. The only workaround is the one you mentioned already. That is create a segment class instead.
@cleftheris thanks!